diff options
author | Marton Balint <cus@passwd.hu> | 2024-01-28 02:45:35 +0100 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2024-02-04 20:04:18 +0100 |
commit | 52cc89dc451f80fbcb0db9a5ade9bd41bd8594c8 (patch) | |
tree | d9c22b8adc1422749bd4985bdcfb59e3e927e5f0 /libavfilter/yadif.h | |
parent | 268062fa15e1c05310f9c3977e0b95ac07eca274 (diff) | |
download | ffmpeg-52cc89dc451f80fbcb0db9a5ade9bd41bd8594c8.tar.gz |
avfilter/yadif_common: fix timestamps with very small timebases
Yadif filter assumed that the output timebase is always half of the input
timebase. This is not true if halving the input time base is not representable
as an AVRational causing the output timestamps to be invalidly scaled in such a
case.
So let's use av_reduce instead of av_mul_q when calculating the output time
base and if the conversion is inexact then let's fall back to the original
timebase which probably makes more parctical sense than using x/INT_MAX.
Fixes invalidly scaled pts_time values in this command line:
ffmpeg -f lavfi -i testsrc -vf settb=tb=1/2000000000,yadif,showinfo -f null none
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavfilter/yadif.h')
-rw-r--r-- | libavfilter/yadif.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavfilter/yadif.h b/libavfilter/yadif.h index 2c4fed62d2..888ba12365 100644 --- a/libavfilter/yadif.h +++ b/libavfilter/yadif.h @@ -86,6 +86,8 @@ typedef struct YADIFContext { * the first field. */ int current_field; ///< YADIFCurrentField + + int pts_multiplier; } YADIFContext; void ff_yadif_init_x86(YADIFContext *yadif); |