Message ID | 20230528091416.17927-23-anton@khirnov.net |
---|---|
State | Accepted |
Commit | 106167374c7e14c6e2afb0049897f1a59a25c839 |
Headers | show |
Series | [FFmpeg-devel,01/24] fftools/ffmpeg_mux_init: merge ost_add_from_filter() to ost_add() | expand |
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 |
diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c index 3da3c04d7f..feb014ca31 100644 --- a/fftools/ffmpeg_mux.c +++ b/fftools/ffmpeg_mux.c @@ -386,6 +386,11 @@ void of_streamcopy(OutputStream *ost, const AVPacket *pkt, int64_t dts) AVPacket *opkt = ost->pkt; av_packet_unref(opkt); + + if (of->recording_time != INT64_MAX && + dts >= of->recording_time + start_time) + pkt = NULL; + // EOF: flush output bitstream filters. if (!pkt) { of_output_packet(of, opkt, ost, 1); @@ -407,12 +412,6 @@ void of_streamcopy(OutputStream *ost, const AVPacket *pkt, int64_t dts) return; } - if (of->recording_time != INT64_MAX && - dts >= of->recording_time + start_time) { - close_output_stream(ost); - return; - } - if (av_packet_ref(opkt, pkt) < 0) exit_program(1);