Seek in a timeshifted stream

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
MltvAddon Offline
Junior Member
Posts: 1
Joined: Jul 2017
Reputation: 0
Post: #1

I try to write an addon for a backend that is permanently time-shifting all channels.
That is, at any moment, the backend stores the 4 las hours of all the available channel (about 5 Giga bytes of TS MPEG record file for each channel).

At the moment, I have a working demo able to connect to any channel and play them.
What I cannot figure is how to seek in the ALREADY time-shifted streams.
I read many post on this forum and heavily goggled on this question but I hardly found any clue, so I decided to ask, please excuse me if the question have already been answered.

I handle the stream myself into the addon (pCapabilities->bHandlesInputStream = trueWink because that gave me access to seek callbacks.
It seems that XBMC only consider the part of the stream it as actually read from ReadLiveStream ignoring the beginning and length informations about the real whole stream available on the backend.

-> If I start to read from the beginning of the stream, I have to manually seek to the end to play live.
-> If I start to read from the end (minus a little offset) I play directly live but I cannot seek backward (SeekLiveStream always give a 0 value for iPosition parameter).

Could someone point me on a way to achieve one of this gaols :
Start to read a stream from the beginning but automatically seek at the end (live) when start playing
Catch the time reported in the GUI scrlollbar to programmatically compute the real seek position in the stream ?
Or may be just catch key stokes and manager myself the seek instructions ?

Any suggestion is welcome !
find quote