Skip to content


Subversion checkout URL

You can clone with
Download ZIP


[PVR] Change channelswitching through OSD to be consistent with channel #1497

merged 1 commit into from

2 participants


switching in other parts of the code

Previously, the channel switching from the OSD dialog didn't check if there was a URL linked to the channel. If this is the case, the switching uses the PlayFile call. This is now consistent with the code in GUIWindowPVRCommon.


I've been investigating some more issues with channel switching in combination with the DVBLink addon and I'm a bit confused by all the different ways there are for switching channels.

Sometimes a switch is just executed as a PlayFile() call, while other times there's some more elaborate checking to see if the channel has a URL or not and then make a decision based on that.

The easiest way would of course be to 'just' use the PlayFile() call (which is what actually happens from CGUIDialogPVRGuideInfo), but there must be good reasons for implementing it different in the other places.

What is the preferred way?


use PlayFile() when nothing is playing, and ACTION_CHANNEL_SWITCH when a pvr stream is playing. PlayFile() will work, but it's slow as it always stop and restarts the player, which isn't always needed


Well, in this specific case, URLs are being used, which seems to imply there always needs to be a PlayFile() call. Some more digging seemed to indicate that the long delay I'm debugging may be caused by the 'CloseStream' in CPVRClients.SwitchChannel.

You may want to hold off on this PR until I've done some more research.

@opdenkamp opdenkamp was assigned

I've researched this issue some further, and the slow channel changing seems to be caused by the 'early' closing of the stream when a URL-stream is being used. This seems to confuse the dvdplayer, where it keeps waiting until some timeout, sometimes up to 60 seconds. Moving the 'CloseStream' into the non-URL stream codepath fixes this issue for the DVBLink-based URL streams and doesn't change behaviour for the non-URL streams.


right that's nasty. got a patch?


Well, my patch is included in this pull request. Seems a safe way to go for me, just don't know if it's the best way...


right, thought you had some other patch and didn't read this one. sorry, was late :)

@opdenkamp opdenkamp merged commit 8749d78 into xbmc:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 3, 2012
  1. @avdleeuw
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  xbmc/pvr/addons/PVRClients.cpp
2  xbmc/pvr/addons/PVRClients.cpp
@@ -302,9 +302,9 @@ bool CPVRClients::SwitchChannel(const CPVRChannel &channel)
// stream URL should always be opened as a new file
!channel.StreamURL().IsEmpty() || !currentChannel->StreamURL().IsEmpty())
- CloseStream();
if (channel.StreamURL().IsEmpty())
+ CloseStream();
bSwitchSuccessful = OpenStream(channel, true);
Something went wrong with that request. Please try again.