]> git.sesse.net Git - ffmpeg/commitdiff
avformat/oggparsetheora: Don't update start time when lastpts is AV_NOPTS_VALUE.
authorDale Curtis <dalecurtis@chromium.org>
Fri, 15 May 2020 19:37:02 +0000 (12:37 -0700)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 30 May 2020 22:52:08 +0000 (00:52 +0200)
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/oggparsetheora.c

index c481a79d4b7a92fc909fd5407943b33964c217c3..d1064e4328db062f4efa961c33f81df05d996314 100644 (file)
@@ -193,7 +193,7 @@ static int theora_packet(AVFormatContext *s, int idx)
         if (pts != AV_NOPTS_VALUE)
             pts = av_sat_sub64(pts, duration);
         os->lastpts = os->lastdts = pts;
-        if(s->streams[idx]->start_time == AV_NOPTS_VALUE) {
+        if(s->streams[idx]->start_time == AV_NOPTS_VALUE && os->lastpts != AV_NOPTS_VALUE) {
             s->streams[idx]->start_time = os->lastpts;
             if (s->streams[idx]->duration > 0)
                 s->streams[idx]->duration -= s->streams[idx]->start_time;