fftools/ffmpeg_enc: set audio frame duration when encoding

This commit is contained in:
Anton Khirnov 2023-04-14 11:24:39 +02:00
parent 9a44e0335c
commit af286f17a1
1 changed files with 2 additions and 0 deletions

View File

@ -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;