You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
lavfi: ensure audio frame durations match the sample count
This commit is contained in:
@@ -997,6 +997,14 @@ int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
|
||||
av_log(link->dst, AV_LOG_ERROR, "Sample rate change is not supported\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
frame->duration = av_rescale_q(frame->nb_samples, (AVRational){ 1, frame->sample_rate },
|
||||
link->time_base);
|
||||
#if FF_API_PKT_DURATION
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
frame->pkt_duration = frame->duration;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
}
|
||||
|
||||
link->frame_blocked_in = link->frame_wanted_out = 0;
|
||||
|
Reference in New Issue
Block a user