diff mbox series

[FFmpeg-devel] ffmpeg: return no chosen output if an uninitialized stream is unavailable

Message ID 20210506212215.7931-1-jeebjp@gmail.com
State Accepted
Commit ec20b8130269260f3ae1e4642da26ba556814f84
Headers show
Series [FFmpeg-devel] ffmpeg: return no chosen output if an uninitialized stream is unavailable | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Jan Ekström May 6, 2021, 9:22 p.m. UTC
Otherwise the rate emulation logic in `transcode_step` never gets
hit, and the unavailability flag never gets reset, leading to an
eternal loop.

Fixes #9160
---
 fftools/ffmpeg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Ekström May 12, 2021, 9:04 a.m. UTC | #1
On Fri, May 7, 2021 at 12:22 AM Jan Ekström <jeebjp@gmail.com> wrote:
>
> Otherwise the rate emulation logic in `transcode_step` never gets
> hit, and the unavailability flag never gets reset, leading to an
> eternal loop.
>
> Fixes #9160
> ---

I will be double-checking after $dayjob whether there is another area
where the fix for this issue would be more applicable, but if I cannot
come up with a better way of dealing with this - as at least one user
has confirmed that this fixes all of his issues with relation to -re
and -ss (among other things) - I will be applying this to master and
release/4.4, both of which are affected.

Jan
Jan Ekström May 13, 2021, 3:11 p.m. UTC | #2
On Fri, May 7, 2021 at 12:22 AM Jan Ekström <jeebjp@gmail.com> wrote:
>
> Otherwise the rate emulation logic in `transcode_step` never gets
> hit, and the unavailability flag never gets reset, leading to an
> eternal loop.
>
> Fixes #9160
> ---
>  fftools/ffmpeg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index 3ad11452da..b3658d8f65 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -3958,7 +3958,7 @@ static OutputStream *choose_output(void)
>                  ost->st->index, ost->st->id, ost->initialized, ost->inputs_done, ost->finished);
>
>          if (!ost->initialized && !ost->inputs_done)
> -            return ost;
> +            return ost->unavailable ? NULL : ost;
>
>          if (!ost->finished && opts < opts_min) {
>              opts_min = opts;
> --
> 2.31.1
>

Added some extra explanation on the commit message and applied as
ec20b8130269260f3ae1e4642da26ba556814f84 to master.

Will also cherry-pick this to release/4.4 as it is also affected.

Jan
Jan Ekström May 13, 2021, 3:21 p.m. UTC | #3
On Thu, May 13, 2021 at 6:11 PM Jan Ekström <jeebjp@gmail.com> wrote:
>
> On Fri, May 7, 2021 at 12:22 AM Jan Ekström <jeebjp@gmail.com> wrote:
> >
> > Otherwise the rate emulation logic in `transcode_step` never gets
> > hit, and the unavailability flag never gets reset, leading to an
> > eternal loop.
> >
> > Fixes #9160
> > ---
> >  fftools/ffmpeg.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> > index 3ad11452da..b3658d8f65 100644
> > --- a/fftools/ffmpeg.c
> > +++ b/fftools/ffmpeg.c
> > @@ -3958,7 +3958,7 @@ static OutputStream *choose_output(void)
> >                  ost->st->index, ost->st->id, ost->initialized, ost->inputs_done, ost->finished);
> >
> >          if (!ost->initialized && !ost->inputs_done)
> > -            return ost;
> > +            return ost->unavailable ? NULL : ost;
> >
> >          if (!ost->finished && opts < opts_min) {
> >              opts_min = opts;
> > --
> > 2.31.1
> >
>
> Added some extra explanation on the commit message and applied as
> ec20b8130269260f3ae1e4642da26ba556814f84 to master.
>
> Will also cherry-pick this to release/4.4 as it is also affected.

Cherry-picked into release/4.4 as 70405dd7e31cd436e9ffa252124537df253a5dc3 .

Jan
diff mbox series

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 3ad11452da..b3658d8f65 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -3958,7 +3958,7 @@  static OutputStream *choose_output(void)
                 ost->st->index, ost->st->id, ost->initialized, ost->inputs_done, ost->finished);
 
         if (!ost->initialized && !ost->inputs_done)
-            return ost;
+            return ost->unavailable ? NULL : ost;
 
         if (!ost->finished && opts < opts_min) {
             opts_min = opts;