diff mbox series

[FFmpeg-devel] fftools/ffmpeg: do not return finished streams from choose_output()

Message ID 20230327051555.11023-1-anton@khirnov.net
State Accepted
Commit e1d12aaa453b267011c388f7de8cfb6936d08fec
Headers show
Series [FFmpeg-devel] fftools/ffmpeg: do not return finished streams from choose_output() | expand

Checks

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

Commit Message

Anton Khirnov March 27, 2023, 5:15 a.m. UTC
---
Should be fixed by this patch.
---
 fftools/ffmpeg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer March 29, 2023, 5:59 p.m. UTC | #1
On Mon, Mar 27, 2023 at 07:15:56AM +0200, Anton Khirnov wrote:
> ---
> Should be fixed by this patch.
> ---
>  fftools/ffmpeg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This:

/home/michael/ffmpeg-git/ffmpeg/ffmpeg -y -threads:a 1 -i /home/michael/tickets//1208/702121h264-TTA.mkvtest82.mkv -bitexact -vn doom_tmp/regress/file1208.mkv
Error while decoding stream #0:1: Invalid data found when processing input
    Last message repeated 5 times
[matroska,webm @ 0x55e2e82919c0] File ended prematurely
Error while decoding stream #0:1: Invalid data found when processing input
    Last message repeated 1 times
[sost#0:1/ssa @ 0x55e2e82ca300] Error submitting a packet to the muxer
    Last message repeated 12465121 times
                          ^^^^^^^^
keeps counting until killed

(tested with khirnov/ffmpeg_frame_size
 it seems the new patch was in this)

thx

[...]
Anton Khirnov March 30, 2023, 8:48 a.m. UTC | #2
Quoting Michael Niedermayer (2023-03-29 19:59:09)
> On Mon, Mar 27, 2023 at 07:15:56AM +0200, Anton Khirnov wrote:
> > ---
> > Should be fixed by this patch.
> > ---
> >  fftools/ffmpeg.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> This:
> 
> /home/michael/ffmpeg-git/ffmpeg/ffmpeg -y -threads:a 1 -i /home/michael/tickets//1208/702121h264-TTA.mkvtest82.mkv -bitexact -vn doom_tmp/regress/file1208.mkv
> Error while decoding stream #0:1: Invalid data found when processing input
>     Last message repeated 5 times
> [matroska,webm @ 0x55e2e82919c0] File ended prematurely
> Error while decoding stream #0:1: Invalid data found when processing input
>     Last message repeated 1 times
> [sost#0:1/ssa @ 0x55e2e82ca300] Error submitting a packet to the muxer
>     Last message repeated 12465121 times
>                           ^^^^^^^^
> keeps counting until killed
> 
> (tested with khirnov/ffmpeg_frame_size
>  it seems the new patch was in this)

Where can I get the sample? The link in ticket 1208 is apparently no
longer valid.
Michael Niedermayer April 2, 2023, 3:58 p.m. UTC | #3
On Thu, Mar 30, 2023 at 10:48:21AM +0200, Anton Khirnov wrote:
> Quoting Michael Niedermayer (2023-03-29 19:59:09)
> > On Mon, Mar 27, 2023 at 07:15:56AM +0200, Anton Khirnov wrote:
> > > ---
> > > Should be fixed by this patch.
> > > ---
> > >  fftools/ffmpeg.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > This:
> > 
> > /home/michael/ffmpeg-git/ffmpeg/ffmpeg -y -threads:a 1 -i /home/michael/tickets//1208/702121h264-TTA.mkvtest82.mkv -bitexact -vn doom_tmp/regress/file1208.mkv
> > Error while decoding stream #0:1: Invalid data found when processing input
> >     Last message repeated 5 times
> > [matroska,webm @ 0x55e2e82919c0] File ended prematurely
> > Error while decoding stream #0:1: Invalid data found when processing input
> >     Last message repeated 1 times
> > [sost#0:1/ssa @ 0x55e2e82ca300] Error submitting a packet to the muxer
> >     Last message repeated 12465121 times
> >                           ^^^^^^^^
> > keeps counting until killed
> > 
> > (tested with khirnov/ffmpeg_frame_size
> >  it seems the new patch was in this)
> 
> Where can I get the sample? The link in ticket 1208 is apparently no
> longer valid.

sorry
its here:
https://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket1208/702121h264-TTA.mkvtest82.mkv

thx

[...]
diff mbox series

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index ae69d29ab7..f1fdbd47eb 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2402,7 +2402,7 @@  static OutputStream *choose_output(void)
                     ost->initialized, ost->inputs_done, ost->finished);
         }
 
-        if (!ost->initialized && !ost->inputs_done)
+        if (!ost->initialized && !ost->inputs_done && !ost->finished)
             return ost->unavailable ? NULL : ost;
 
         if (!ost->finished && opts < opts_min) {