]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/oggparsetheora.c
avcodec: Remove unneeded getters and setters
[ffmpeg] / libavformat / oggparsetheora.c
index 87a676fe482f29a96a8f269d776637619b5bf52f..d1064e4328db062f4efa961c33f81df05d996314 100644 (file)
@@ -191,9 +191,9 @@ static int theora_packet(AVFormatContext *s, int idx)
 
         pts = theora_gptopts(s, idx, os->granule, NULL);
         if (pts != AV_NOPTS_VALUE)
-            pts -= duration;
+            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;