fftools/ffmpeg: call check_recording_time() with actual frame pts

Not its estimated value that will not necessarily be used.
pull/388/head
Anton Khirnov 2 years ago
parent 86a71d6b3c
commit 617ea07c22
  1. 6
      fftools/ffmpeg.c

@ -936,9 +936,6 @@ static void do_audio_out(OutputFile *of, OutputStream *ost,
AVCodecContext *enc = ost->enc_ctx; AVCodecContext *enc = ost->enc_ctx;
int ret; int ret;
if (!check_recording_time(ost, ost->next_pts, ost->enc_ctx->time_base))
return;
if (frame->pts == AV_NOPTS_VALUE) if (frame->pts == AV_NOPTS_VALUE)
frame->pts = ost->next_pts; frame->pts = ost->next_pts;
else { else {
@ -949,6 +946,9 @@ static void do_audio_out(OutputFile *of, OutputStream *ost,
} }
frame->time_base = enc->time_base; frame->time_base = enc->time_base;
if (!check_recording_time(ost, frame->pts, frame->time_base))
return;
ost->next_pts = frame->pts + frame->nb_samples; ost->next_pts = frame->pts + frame->nb_samples;
ret = submit_encode_frame(of, ost, frame); ret = submit_encode_frame(of, ost, frame);

Loading…
Cancel
Save