aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-04-14 11:24:39 +0200
committerAnton Khirnov <anton@khirnov.net>2023-04-19 21:12:03 +0200
commitaf286f17a1c79b6d543c586cf020d08d4e84f0eb (patch)
tree8eb79007f4de2053f44ee05a868a34fefb6f896c
parent9a44e0335c0b0ba54ec854e2579f9bb7237032f5 (diff)
downloadffmpeg-af286f17a1c79b6d543c586cf020d08d4e84f0eb.tar.gz
fftools/ffmpeg_enc: set audio frame duration when encoding
-rw-r--r--fftools/ffmpeg_enc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
index 45bf4b127f..a35c9f60e5 100644
--- a/fftools/ffmpeg_enc.c
+++ b/fftools/ffmpeg_enc.c
@@ -811,6 +811,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;