diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-06-18 20:09:55 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-18 20:09:55 +0200 |
commit | 1d54f5108477938268d51162be536cecd746e56a (patch) | |
tree | d3d07b6c734fdd1fd75ec89c67a27be4c3d5e836 /libavformat/mux.c | |
parent | 75511c293add07db1cca58dcd8b08c33fc2f1075 (diff) | |
download | ffmpeg-1d54f5108477938268d51162be536cecd746e56a.tar.gz |
avformat/mux: simplify ff_choose_timebase()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r-- | libavformat/mux.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c index f542c9e686..afdeca1afb 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -107,11 +107,8 @@ AVRational ff_choose_timebase(AVFormatContext *s, AVStream *st, int min_precisio AVRational q; int j; - if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { - q = (AVRational){1, st->codec->sample_rate}; - } else { - q = st->codec->time_base; - } + q = st->time_base; + for (j=2; j<14; j+= 1+(j>2)) while (q.den / q.num < min_precision && q.num % j == 0) q.num /= j; |