]> git.sesse.net Git - ffmpeg/commitdiff
doc/examples/muxing: fix underflow in duration of encoded streams
authorPaul B Mahol <onemda@gmail.com>
Fri, 27 Sep 2019 09:41:38 +0000 (11:41 +0200)
committerPaul B Mahol <onemda@gmail.com>
Sun, 29 Sep 2019 18:41:29 +0000 (20:41 +0200)
Now they are exactly 10 seconds long.

Fixes #5684.

doc/examples/muxing.c

index 08da98e574a91fcc364b8432a095870e74facb1c..9af9aae4834acb00a90a24b845d706c4d62bac59 100644 (file)
@@ -285,7 +285,7 @@ static AVFrame *get_audio_frame(OutputStream *ost)
 
     /* check if we want to generate more frames */
     if (av_compare_ts(ost->next_pts, ost->enc->time_base,
-                      STREAM_DURATION, (AVRational){ 1, 1 }) >= 0)
+                      STREAM_DURATION, (AVRational){ 1, 1 }) > 0)
         return NULL;
 
     for (j = 0; j <frame->nb_samples; j++) {
@@ -464,7 +464,7 @@ static AVFrame *get_video_frame(OutputStream *ost)
 
     /* check if we want to generate more frames */
     if (av_compare_ts(ost->next_pts, c->time_base,
-                      STREAM_DURATION, (AVRational){ 1, 1 }) >= 0)
+                      STREAM_DURATION, (AVRational){ 1, 1 }) > 0)
         return NULL;
 
     /* when we pass a frame to the encoder, it may keep a reference to it