Message ID | 20230414164244.15264-6-anton@khirnov.net |
---|---|
State | Accepted |
Commit | af286f17a1c79b6d543c586cf020d08d4e84f0eb |
Headers | show |
Series | [FFmpeg-devel,1/7] lavfi: ensure audio frame durations match the sample count | expand |
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index a0779c45ae..00cccef65b 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -795,6 +795,8 @@ static void do_audio_out(OutputFile *of, OutputStream *ost, av_rescale_q(start_time, AV_TIME_BASE_Q, enc->time_base); } frame->time_base = enc->time_base; + frame->duration = av_rescale_q(frame->nb_samples, (AVRational){1, frame->sample_rate}, + enc->time_base); if (!check_recording_time(ost, frame->pts, frame->time_base)) return;