diff mbox series

[FFmpeg-devel,09/13] fftools/ffmpeg: call check_recording_time() with actual frame pts

Message ID 20221126081911.31275-9-anton@khirnov.net
State Accepted
Commit 617ea07c220b1c5cce5de56ab5c3cfaaf376d357
Headers show
Series [FFmpeg-devel,01/13] fftools/ffmpeg: stop explicitly closing decoders | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Nov. 26, 2022, 8:19 a.m. UTC
Not its estimated value that will not necessarily be used.
---
 fftools/ffmpeg.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

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