summaryrefslogtreecommitdiff
path: root/avconv.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-02-02 13:18:49 +0100
committerAnton Khirnov <anton@khirnov.net>2012-02-07 20:14:54 +0100
commit722410ade56f67b474e4d0e5684e66d4942f5973 (patch)
tree2d713a40e390e4b23d3f0c515f852d159b463a82 /avconv.c
parentb34856a116f7ea4748ee7c89bfe1f1bc135d079d (diff)
avconv: estimate next_dts from framerate if it is set.
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/avconv.c b/avconv.c
index 92af92430c..0c3d384571 100644
--- 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;