[FFmpeg-devel] [EXTREMELY IMPORTANT] [PLEASE DO NOT IGNORE] [PATCH] avfilter/framesync: do not pick AV_TIME_BASE for time base when not needed.

Paul B Mahol onemda at gmail.com
Sun Feb 2 12:45:18 EET 2020


On 2/2/20, Nicolas George <george at nsup.org> wrote:
> Paul B Mahol (12020-02-01):
>> Fixes picking time base when all input time bases are same and for
>> example
>> 20833/500000.
>>
>> Signed-off-by: Paul B Mahol <onemda at gmail.com>
>> ---
>>  libavfilter/framesync.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavfilter/framesync.c b/libavfilter/framesync.c
>> index bc95f7d904..94abb469e6 100644
>> --- a/libavfilter/framesync.c
>> +++ b/libavfilter/framesync.c
>> @@ -144,7 +144,7 @@ int ff_framesync_configure(FFFrameSync *fs)
>>                  if (fs->time_base.num) {
>>                      gcd = av_gcd(fs->time_base.den,
>> fs->in[i].time_base.den);
>>                      lcm = (fs->time_base.den / gcd) *
>> fs->in[i].time_base.den;
>> -                    if (lcm < AV_TIME_BASE / 2) {
>> +                    if (lcm <= AV_TIME_BASE / 2) {
>>                          fs->time_base.den = lcm;
>>                          fs->time_base.num = av_gcd(fs->time_base.num,
>>
>> fs->in[i].time_base.num);
>
> Picking AV_TIME_BASE for a decimal approximation of 1/24 seems like the
> right thing to do. Also, since this change only affects the case with
> equality, there is no loss of precision. I'll keep the code as is,
> unless there's a better reason.

Changing time base when all inputs have same time base seems strange
and excessive to me.
Is there something wrong with my patch or you just prefer status quo?


More information about the ffmpeg-devel mailing list