fftools/ffmpeg_filter: make sure pkt_duration matches duration

Otherwise the two values might get desynchronized and lavfi can prefer
the wrong one.
This commit is contained in:
Anton Khirnov 2023-05-10 12:19:58 +02:00
parent 14b9946967
commit 1132507327
1 changed files with 5 additions and 0 deletions

View File

@ -1622,6 +1622,11 @@ int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame, int keep_reference)
frame->pts = av_rescale_q(frame->pts, frame->time_base, ifp->time_base);
frame->duration = av_rescale_q(frame->duration, frame->time_base, ifp->time_base);
frame->time_base = ifp->time_base;
#if LIBAVUTIL_VERSION_MAJOR < 59
AV_NOWARN_DEPRECATED(
frame->pkt_duration = frame->duration;
)
#endif
ret = av_buffersrc_add_frame_flags(ifilter->filter, frame,
AV_BUFFERSRC_FLAG_PUSH);