ff_choose_timebase: only try factors upto 14

otherwise a unexpected timebase could be choosen
that is one that is thousand times more precisse than requested
which can have sideeffects.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-10-03 21:38:56 +02:00
parent de707bc8bd
commit 5e6439a125

View File

@ -113,7 +113,7 @@ AVRational ff_choose_timebase(AVFormatContext *s, AVStream *st, int min_precissi
} else {
q = st->codec->time_base;
}
for (j=2; j<2000; j+= 1+(j>2))
for (j=2; j<14; j+= 1+(j>2))
while (q.den / q.num < min_precission && q.num % j == 0)
q.num /= j;
while (q.den / q.num < min_precission && q.den < (1<<24))