[FFmpeg-devel] libavformat: fix inputs initialization in mpegts muxer with filters

Submitted by Oliver Collyer via ffmpeg-devel on April 18, 2019, 11:14 a.m.

Details

Message ID nvdVQQMjIOGbxgeE6X0sxhqslfO3bkiUJJ0E6iITd3tOos-10wap9JagYecFfUgWvF2YpCOXzOUJQFE5WNHkaytzze99Cz6g8g-Khy0u2UI=@protonmail.com
State New
Headers show

Commit Message

Oliver Collyer via ffmpeg-devel April 18, 2019, 11:14 a.m.
> On Wed, Apr 17, 2019 at 08:28:39PM +0000, Andreas Håkon via ffmpeg-devel wrote:
>
> > This patch solves the initialization of the inputs when using filters (a graph filter) with the mpegts muxer.
> > This bug seems to be generated by a simple forgetting to copy. The same code is repeated two times, but only in one case the variable “inputs_done” is initialized. Compare the two blocks:
>
> This text should be in the commit message.
> also a testcase would be usefull, a fate test even better
>

Done!

Regards.
A.H.


---
From af81338c21c67c0ef2c30ab2009c7094b32327f4 Mon Sep 17 00:00:00 2001
From: Andreas Hakon <andreas.hakon@protonmail.com>
Date: Wed, 17 Apr 2019 21:22:43 +0100
Subject: [PATCH] libavformat: input init fix mpegts filters

This patch solves the initialization of the inputs when using filters 
(a graph filter) with the mpegts muxer.

This bug seems to be generated by a simple forgetting to copy. The same code is
repeated two times, but only in one case the variable inputs_done is initialized.

Testcase:
 $ ffmpeg -f mpegts -i mpeg.ts \ 
   -filter_complex "[i:100]fps=fps=25[out]" \
   -map "[out]" -c:v libx264 -f mpegts out.ts

Signed-off-by: Andreas Hakon <andreas.hakon@protonmail.com>
---
 fftools/ffmpeg.c    |    8 ++++++--
 libavformat/utils.c |    4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)

1.7.10.4

Comments

Oliver Collyer via ffmpeg-devel April 18, 2019, 11:18 a.m.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Thursday, 18 de April de 2019 13:14, Andreas Håkon <andreas.hakon@protonmail.com> wrote:

> > On Wed, Apr 17, 2019 at 08:28:39PM +0000, Andreas Håkon via ffmpeg-devel wrote:
> >
> > > This patch solves the initialization of the inputs when using filters (a graph filter) with the mpegts muxer.
> > > This bug seems to be generated by a simple forgetting to copy. The same code is repeated two times, but only in one case the variable “inputs_done” is initialized. Compare the two blocks:
> >
> > This text should be in the commit message.
> > also a testcase would be usefull, a fate test even better
>
> Done!
>
> Regards.
> A.H.
>

Hi Michael,

Your request is now here:
https://patchwork.ffmpeg.org/patch/12794/

Mark as superseded both:
https://patchwork.ffmpeg.org/patch/12783/
https://patchwork.ffmpeg.org/patch/12790/

And please review the second part:
https://patchwork.ffmpeg.org/patch/12791/

Regards.
A.H.


---
Michael Niedermayer April 18, 2019, 8:07 p.m.
On Thu, Apr 18, 2019 at 11:14:39AM +0000, Andreas Håkon via ffmpeg-devel wrote:
> 
> > On Wed, Apr 17, 2019 at 08:28:39PM +0000, Andreas Håkon via ffmpeg-devel wrote:
> >
> > > This patch solves the initialization of the inputs when using filters (a graph filter) with the mpegts muxer.
> > > This bug seems to be generated by a simple forgetting to copy. The same code is repeated two times, but only in one case the variable “inputs_done” is initialized. Compare the two blocks:
> >
> > This text should be in the commit message.
> > also a testcase would be usefull, a fate test even better
> >
> 
> Done!
> 
> Regards.
> A.H.
> 
> 
> ---
> 

> From af81338c21c67c0ef2c30ab2009c7094b32327f4 Mon Sep 17 00:00:00 2001
> From: Andreas Hakon <andreas.hakon@protonmail.com>
> Date: Wed, 17 Apr 2019 21:22:43 +0100
> Subject: [PATCH] libavformat: input init fix mpegts filters

fails to apply cleanly

Applying: libavformat: fix inputs initialization in mpegts muxer with filters
Using index info to reconstruct a base tree...
error: patch failed: fftools/ffmpeg.c:4613
error: fftools/ffmpeg.c: patch does not apply
error: Did you hand edit your patch?
It does not apply to blobs recorded in its index.
Patch failed at 0001 libavformat: fix inputs initialization in mpegts muxer with filters

[...]
Michael Niedermayer April 18, 2019, 8:10 p.m.
On Thu, Apr 18, 2019 at 11:18:13AM +0000, Andreas Håkon via ffmpeg-devel wrote:
> 
> 
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Thursday, 18 de April de 2019 13:14, Andreas Håkon <andreas.hakon@protonmail.com> wrote:
> 
> > > On Wed, Apr 17, 2019 at 08:28:39PM +0000, Andreas Håkon via ffmpeg-devel wrote:
> > >
> > > > This patch solves the initialization of the inputs when using filters (a graph filter) with the mpegts muxer.
> > > > This bug seems to be generated by a simple forgetting to copy. The same code is repeated two times, but only in one case the variable “inputs_done” is initialized. Compare the two blocks:
> > >
> > > This text should be in the commit message.
> > > also a testcase would be usefull, a fate test even better
> >
> > Done!
> >
> > Regards.
> > A.H.
> >
> 
> Hi Michael,
> 
> Your request is now here:
> https://patchwork.ffmpeg.org/patch/12794/
> 
> Mark as superseded both:
> https://patchwork.ffmpeg.org/patch/12783/
> https://patchwork.ffmpeg.org/patch/12790/

better to automate such things, human time is limited
if you want you could send a patch to:
https://github.com/michaelni/patchwork-update-bot
so that split patches are detected and the parent superseded

thx

[...]

Patch hide | download patch | download mbox

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 0f157d6..b74a209 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -4613,9 +4613,10 @@  static int transcode_step(void)
         }
         if ((ret = transcode_from_filter(ost->filter->graph, &ist)) < 0)
             return ret;
-        if (!ist)
+        if (!ist) {
+            ost->inputs_done = 1;
             return 0;
+        }
     } else if (ost->filter) {
         int i;
         for (i = 0; i < ost->filter->graph->nb_inputs; i++) {
--