[PVR] Add timeshift support (requires backend support) #1504

wants to merge 5 commits into


None yet

6 participants


This PR extends the PVR API to allow pause, rewind and forward of LiveTV streams if the backend supports it.

A PVR addon can tell XBMC for each individual backend channel whether it supports timeshifting for this channel or not.
XBMC will enable the corresponding buttons if the selected channel can timeshift.

Summary of the changes:

  • Confluence skin extended with extra buttons
  • PVR API extended with PauseLiveStream() and PauseRecordedStream() functions to tell the PVR addon that XBMC paused playback. This can be used by the pvr addon to pause for example a RTSP stream.
  • PVR channel updated with a CanTimeshift property
@margro margro referenced this pull request in opdenkamp/xbmc-pvr-addons Sep 29, 2012

Timeshift support (pvr-addons side) #46

Team Kodi member

Check for ILiveTV (or what the interface is called) in dvdplayer instead of isstreamtype pvr, when doing the pause

Also, why does application need to block pause actions? IMHO they should only be blocked in dvdplayer for live tv.


@elupus Agreed. It is cleaner to move it to the dvdplayer. The only reason I can think of why the existing check for LiveTV was in application is maybe to support other players.
I will move the check to the dvdplayer code.

@opdenkamp opdenkamp was assigned Sep 30, 2012

@opdenkamp: that is also an option unless you mean "add back the property bSupportsTimeshift to the PVR_ADDON_CAPABILITIES" as it was before the PVR merge.
I would like to check the property for each channel individually because the MediaPortal addon can return a mixed channel set (both web channels and real tv channels). Some channel can be paused, while other can't.
It is now done at channel scan time, but I can ask the PVR addon at tune time whether it support timeshifting for the newly selected channel.

How would you like to see this? Extend the PVR_STREAM_PROPERTIES or PVR_SIGNAL_STATUS struct or add a dedicated CanTimeshift function instead?

Team Kodi member

if this can be different per channel for one add-on, then i prefer adding it to PVR_STREAM_PROPERTIES. thanks


Ok, I will try to update it using the PVR_STREAM_PROPERTIES struct although I'm not yet sure if I can get the order right for updating the enabled state of the GUI buttons.
Furthermore, this requires that the PVR addon always knows which channel is playing in order to return the proper CanTimeshift() answer.
For example: what should happen if the channel uses a StreamURL and XBMC directly opens the URL?
Will XBMC then execute the PVR addon's GetStreamProperties() to see if the timeshift buttons should be enabled?
And how should the addon then know which channel is active?

Team Kodi member

I'll have to verify this for stream url.

Team Kodi member

nope, it's not read with those. go for the CanTimeshift() method instead then.


Thanks for checking. Will update the code to add CanTimeshift instead


I tried to apply this patch on top of f674404 and installed xbmc-addon-xvdr - XBMC crashes with segmentation fault when switching to any channel. Without the patch everything works fine. Tested on Ubuntu 12.04 with kernels 3.0.2 and 3.0.5.


@AndreyPavlenko That won't work without adapting the also the xvdr addon. This pull request changes the PVR API, so all addons need to be updated. The segmentation fault is probably caused by a mismatch between the struct sizes in XBMC and your pvr addon (if you didn't modify also the addon sources).
Furthermore, this pull request only provides the required infrastructure for timehifting. It requires proper backend support and an extension of the pvr addon. I don't know the XVDR stuff good enough to know if this backend has timeshift support.

@margro margro referenced this pull request in opdenkamp/xbmc-pvr-addons Oct 6, 2012

PVR API update to v1.50 (Timeshift support, pvr-addons update) #50


I've updated this pull request to incorporate the remarks and suggestions.
The previous database change is now replaced by the CanTimeshift() function.

The application.cpp file check on livetv is now moved to the dvdplayer instead as suggested by elupus


Updated with the remarks from @da-anda (generic names).
There is no reference to the word timeshift anymore.

Team Kodi member

Nice work, thanks. Fine now from my side :) The mentioned typo above can be fixed when squashing I think.

@da-anda da-anda closed this Oct 8, 2012
@opdenkamp opdenkamp reopened this Oct 8, 2012
Team Kodi member

Argh, sorry for closing, damn small smartphone, was actually just scrolling :(

Team Kodi member

looking sane to me. i'll test it tomorrow, and merge it in with a little Trigger...() method that i wanted to add earlier but forgot, so we don't need another bump.

margro added some commits Oct 9, 2012
@margro margro Confluence: add extra PVR buttons to support pause and seek
These buttons are only enabled when the current PVR backend supports pause and seek for the current playing stream
@margro margro pvr: extend the PVR API to allow pause and seek for LiveTV and record…
…ings when the backend supports it

- Add CanPauseStream and CanSeekStream functions enable/disable pause and seek for the current playing stream
- Add PauseStream function to notify the backend that XBMC paused playback
@margro margro pvr: add the PauseStream, CanPauseStream and CanSeekStream functions …
…to the PVRClient(s) classes
@margro margro dvdplayer: add support for pause and seek of LiveTV and recordings
This functionality is only enabled when the PVR backend reports that it is supported
@margro margro pvr: enable pause and seek when the PVR backend supports it for the c…
…urrent playing stream

Fixed the c+p mistakes. Thanks for checking.


Thanks margro. XVDR does not support timeshift. Are there any addons for tvheadend/vdr backends that support timeshifting?

Team Kodi member

There's a forum for such question

@opdenkamp opdenkamp closed this in 07b13cc Oct 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment