]> git.sesse.net Git - ffmpeg/commit
applehttp: Fix seeking in streams not starting at DTS=0
authorPanagiotis H.M. Issaris <takis.issaris@uhasselt.be>
Tue, 15 Nov 2011 17:35:03 +0000 (18:35 +0100)
committerMartin Storsjö <martin@martin.st>
Fri, 18 Nov 2011 09:33:44 +0000 (11:33 +0200)
commit795d9594cfaf9b6c9ce0c60f86c6e51636096a5a
tree02593ab93fb7b4ddb36092e5ae8ba6ba18979c8e
parentdbc2424baa5aa4c72026d167f0678f2374620f44
applehttp: Fix seeking in streams not starting at DTS=0

The Apple HTTP Live Streaming demuxer's implementation of
seeking searches for the MPEG TS segment which contains the
requested timestamp.  In its current implementation it assumes
that the first segment will start from 0.

But, MPEG TS streams do not necessarily start with timestamp
(near) 0, causing seeking to fail for those streams.

This also occurs when using live streaming of HTTP Live Streams.
In this case sliding playlists may be used, which means that in
that case only the last x encoded segments are stored, the earlier
segments get deleted from disk and removed from the playlist.
Because of this, when starting playback of a stream in the middle
of such a broadcast, the initial segment fetched after parsing
the m3u8 playlist will not start from timestamp (near) 0, causing
(the admittedly limited live) seeking to fail.

This patch changes this demuxers seeking implementation to use
the initial DTS as an offset for searching the segments containing
the requested timestamp.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/applehttp.c