]> git.sesse.net Git - ffmpeg/commitdiff
avconv: estimate next_dts from framerate if it is set.
authorAnton Khirnov <anton@khirnov.net>
Thu, 2 Feb 2012 12:18:49 +0000 (13:18 +0100)
committerAnton Khirnov <anton@khirnov.net>
Tue, 7 Feb 2012 19:14:54 +0000 (20:14 +0100)
avconv.c

index 92af92430cbadd5b80969b9480a4e4c5e76cf2b8..0c3d384571da01d34f4115224a2cce6037139f0a 100644 (file)
--- a/avconv.c
+++ b/avconv.c
@@ -2121,6 +2121,10 @@ static int output_packet(InputStream *ist,
             ret = transcode_video    (ist, &avpkt, &got_output, &pkt_pts);
             if (avpkt.duration)
                 ist->next_dts += av_rescale_q(avpkt.duration, ist->st->time_base, AV_TIME_BASE_Q);
+            else if (ist->st->r_frame_rate.num)
+                ist->next_dts += av_rescale_q(1, (AVRational){ist->st->r_frame_rate.den,
+                                                              ist->st->r_frame_rate.num},
+                                              AV_TIME_BASE_Q);
             else if (ist->st->codec->time_base.num != 0) {
                 int ticks      = ist->st->parser ? ist->st->parser->repeat_pict + 1 :
                                                    ist->st->codec->ticks_per_frame;