summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-11-25 23:47:12 +0100
committerAnton Khirnov <anton@khirnov.net>2022-11-28 10:28:14 +0100
commit617ea07c220b1c5cce5de56ab5c3cfaaf376d357 (patch)
tree8e9cfb0c528998f62f0c0a3ffd78e15522c4a69c
parent86a71d6b3c11da9fd0606ddf814affa92eef83cf (diff)
fftools/ffmpeg: call check_recording_time() with actual frame pts
Not its estimated value that will not necessarily be used.
-rw-r--r--fftools/ffmpeg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index cb65f26100..e56681a461 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -936,9 +936,6 @@ static void do_audio_out(OutputFile *of, OutputStream *ost,
AVCodecContext *enc = ost->enc_ctx;
int ret;
- if (!check_recording_time(ost, ost->next_pts, ost->enc_ctx->time_base))
- return;
-
if (frame->pts == AV_NOPTS_VALUE)
frame->pts = ost->next_pts;
else {
@@ -949,6 +946,9 @@ static void do_audio_out(OutputFile *of, OutputStream *ost,
}
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;
ret = submit_encode_frame(of, ost, frame);