[FFmpeg-cvslog] avformat/hls: do not care about stream start timestamps

Anssi Hannula git at videolan.org
Sun Apr 6 16:56:42 CEST 2014


ffmpeg | branch: master | Anssi Hannula <anssi.hannula at iki.fi> | Mon Dec 30 11:46:01 2013 +0200| [8fd6875c83d511dc20390052ccd4d1d567ece152] | committer: Anssi Hannula

avformat/hls: do not care about stream start timestamps

While selecting a packet to return to caller in read_packet(), the code
corrects the timestamps for starting timestamps.

However, this is wrong, since for live streams the initial timestamps
might differ just because of the time delay between the retrieval of the
various Media Playlists.

Fortunately, spec 6.2.4 mandates that all variant streams must have
matching timestamps, so we do not need to correct for initial
timestamps.

Drop the correction code.

Note that ID3 timestamps were previously ignored, so this code was
previously actually needed.

Signed-off-by: Anssi Hannula <anssi.hannula at iki.fi>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8fd6875c83d511dc20390052ccd4d1d567ece152
---

 libavformat/hls.c |    7 -------
 1 file changed, 7 deletions(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index b3019f3..30df7a9 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -1528,19 +1528,12 @@ start:
             } else if (pls->cur_seq_no == minpls->cur_seq_no) {
                 int64_t dts     =    pls->pkt.dts;
                 int64_t mindts  = minpls->pkt.dts;
-                AVStream *st    =    pls->ctx->streams[pls->pkt.stream_index];
-                AVStream *minst = minpls->ctx->streams[minpls->pkt.stream_index];
                 AVRational tb    = get_timebase(   pls);
                 AVRational mintb = get_timebase(minpls);
 
                 if (dts == AV_NOPTS_VALUE) {
                     minplaylist = i;
                 } else if (mindts != AV_NOPTS_VALUE) {
-                    if (st->start_time    != AV_NOPTS_VALUE)
-                        dts    -= st->start_time;
-                    if (minst->start_time != AV_NOPTS_VALUE)
-                        mindts -= minst->start_time;
-
                     if (av_compare_ts(dts, tb,
                                       mindts, mintb) < 0)
                         minplaylist = i;



More information about the ffmpeg-cvslog mailing list