diff options
author | Mans Rullgard <mans@mansr.com> | 2012-07-29 14:58:53 +0100 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2012-08-05 17:46:41 +0100 |
commit | 82494835c4ee2adf5afc51bfd19964b82eb80da9 (patch) | |
tree | cfeb1111d14bb5f6d1d40e605eaa356c4f76be72 /avconv.c | |
parent | 965efc1673074ac1e6c28177a4718ed84f89ac83 (diff) | |
download | ffmpeg-82494835c4ee2adf5afc51bfd19964b82eb80da9.tar.gz |
rational: add av_inv_q() returning the inverse of an AVRational
This allows simplifying a few expressions.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'avconv.c')
-rw-r--r-- | avconv.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -797,8 +797,7 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter, AVFilterContext *first_filter = in->filter_ctx; AVFilter *filter = avfilter_get_by_name("buffer"); InputStream *ist = ifilter->ist; - AVRational tb = ist->framerate.num ? (AVRational){ist->framerate.den, - ist->framerate.num} : + AVRational tb = ist->framerate.num ? av_inv_q(ist->framerate) : ist->st->time_base; AVRational sar; char args[255], name[255]; @@ -2197,8 +2196,7 @@ static int output_packet(InputStream *ist, const AVPacket *pkt) if (avpkt.duration) ist->next_dts += av_rescale_q(avpkt.duration, ist->st->time_base, AV_TIME_BASE_Q); else if (ist->st->avg_frame_rate.num) - ist->next_dts += av_rescale_q(1, (AVRational){ist->st->avg_frame_rate.den, - ist->st->avg_frame_rate.num}, + ist->next_dts += av_rescale_q(1, av_inv_q(ist->st->avg_frame_rate), AV_TIME_BASE_Q); else if (ist->st->codec->time_base.num != 0) { int ticks = ist->st->parser ? ist->st->parser->repeat_pict + 1 : |