avcodec/libvorbisenc: dont add the duration to AV_NOPTS_VALUE
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 21 May 2014 01:02:06 +0000 (03:02 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 25 Jun 2014 21:15:37 +0000 (23:15 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 19e66c7232d96e4ae8f05b52da2b84dfaa4e4da3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/libvorbisenc.c

index 188c8cc..5424f8b 100644 (file)
@@ -362,7 +362,8 @@ static int oggvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
             avctx->delay              = duration;
             av_assert0(!s->afq.remaining_delay);
             s->afq.frames->duration  += duration;
-            s->afq.frames->pts       -= duration;
+            if (s->afq.frames->pts != AV_NOPTS_VALUE)
+                s->afq.frames->pts       -= duration;
             s->afq.remaining_samples += duration;
         }
         ff_af_queue_remove(&s->afq, duration, &avpkt->pts, &avpkt->duration);