summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg_opt.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2022-02-14 14:07:01 -0300
committerJames Almer <jamrial@gmail.com>2022-02-28 12:10:51 -0300
commitafe485ee6b3bbcd4b0e106eb9fc4dcf4846db1b8 (patch)
tree32cd46c17fc1afe94dac7f6d5576e3f27468bb75 /fftools/ffmpeg_opt.c
parent4f21a9ae6b86cc481af4f92249bef877bdf64fdc (diff)
ffmpeg: flush delayed frames in codec copy scenarios
Bitstream filters inserted between the input and output were never drained, resulting in packets being lost if the bsf had any buffered. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'fftools/ffmpeg_opt.c')
-rw-r--r--fftools/ffmpeg_opt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 3102851885..bf1bbcae4c 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -2610,6 +2610,7 @@ loop_end:
if (ost->encoding_needed && ost->source_index >= 0) {
InputStream *ist = input_streams[ost->source_index];
ist->decoding_needed |= DECODING_FOR_OST;
+ ist->processing_needed = 1;
if (ost->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO ||
ost->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
@@ -2622,6 +2623,9 @@ loop_end:
exit_program(1);
}
}
+ } else if (ost->stream_copy && ost->source_index >= 0) {
+ InputStream *ist = input_streams[ost->source_index];
+ ist->processing_needed = 1;
}
/* set the filter output constraints */