From aebf8c70e0355f72ca46c04c1a1dc32f0b0868e1 Mon Sep 17 00:00:00 2001 From: Andreas Baierl Date: Thu, 30 Jan 2025 10:20:57 +0100 Subject: [PATCH 5/5] don't switch to current channel Signed-off-by: Andreas Baierl --- tvguideosd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tvguideosd.c b/tvguideosd.c index f762b12..bfa3a1d 100644 --- a/tvguideosd.c +++ b/tvguideosd.c @@ -459,10 +459,14 @@ eOSState cTvGuideOsd::ChannelSwitch(const cEvent *e) { } eOSState state = osContinue; if (running) { // || !config.intelligentSwitch) { - const cChannel *currentChannel = NULL; + const cChannel *newChannel = NULL; + int currentChannel = 0; { LOCK_CHANNELS_READ; - currentChannel = Channels->GetByChannelID(e->ChannelID()); + newChannel = Channels->GetByChannelID(e->ChannelID()); + currentChannel = cDevice::PrimaryDevice()->CurrentChannel(); + if (currentChannel == newChannel->Number()) + return state; } if (!currentChannel) { return state; @@ -470,7 +474,7 @@ eOSState cTvGuideOsd::ChannelSwitch(const cEvent *e) { if (config.closeOnSwitch) { state = osEnd; } - cDevice::PrimaryDevice()->SwitchChannel(currentChannel, true); + cDevice::PrimaryDevice()->SwitchChannel(newChannel, true); } else { if (detailView) CloseDetailedView(); -- 2.39.5