diff mbox series

[FFmpeg-devel] fftools/ffmpeg: make sure non-lavfi streams are closed on input EOF

Message ID 20230403100954.11563-1-anton@khirnov.net
State Accepted
Commit 416e2661ea9c2b55d5b9e25d687f0d2a839d6cd6
Headers show
Series [FFmpeg-devel] fftools/ffmpeg: make sure non-lavfi streams are closed on input EOF | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov April 3, 2023, 10:09 a.m. UTC
---
Should be fixed by adding this patch to the set, at any point.
Also updated my ffmpeg_frame_size branch.
---
 fftools/ffmpeg.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Michael Niedermayer April 5, 2023, 10:33 p.m. UTC | #1
On Mon, Apr 03, 2023 at 12:09:54PM +0200, Anton Khirnov wrote:
> ---
> Should be fixed by adding this patch to the set, at any point.
> Also updated my ffmpeg_frame_size branch.
> ---
>  fftools/ffmpeg.c | 1 +
>  1 file changed, 1 insertion(+)

Ive tested ffmpeg_frame_size and there are a few cases that change their
output, but i failed to find one that by watching the output looked different
I saw no crashes, infinite loops or other anomalies

Thx

[...]
Anton Khirnov April 6, 2023, 7:27 a.m. UTC | #2
Quoting Michael Niedermayer (2023-04-06 00:33:07)
> On Mon, Apr 03, 2023 at 12:09:54PM +0200, Anton Khirnov wrote:
> > ---
> > Should be fixed by adding this patch to the set, at any point.
> > Also updated my ffmpeg_frame_size branch.
> > ---
> >  fftools/ffmpeg.c | 1 +
> >  1 file changed, 1 insertion(+)
> 
> Ive tested ffmpeg_frame_size and there are a few cases that change their
> output, but i failed to find one that by watching the output looked different
> I saw no crashes, infinite loops or other anomalies

Thanks you for testing, I'd be interested in looking at some of those
changed cases, if the samples are available. While changes in some
corner cases are possible, it'd be nice to make sure that nothing
actually breaks.

Otherwise I'm going to push the set soonish.
diff mbox series

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 438bee8fef..2f1f830507 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -3804,6 +3804,7 @@  static int process_input(int file_index)
                 if (ost->ist == ist &&
                     (!ost->enc_ctx || ost->enc_ctx->codec_type == AVMEDIA_TYPE_SUBTITLE)) {
                     OutputFile *of = output_files[ost->file_index];
+                    close_output_stream(ost);
                     of_output_packet(of, ost->pkt, ost, 1);
                 }
             }