diff mbox

[FFmpeg-devel] lavf/concatdec: do not transfer custom IO flag

Message ID 20170522145431.23321-1-u@pkh.me
State Accepted
Commit 0dcac9c3f0f8f32009098edb704fac4b08bac951
Headers show

Commit Message

Clément Bœsch May 22, 2017, 2:54 p.m. UTC
From: Clément Bœsch <cboesch@gopro.com>

If the source is using a custom IO, setting this flag causes heavy leaks
since the segments will not have their avio context closed.

Regression since f5da453b068f55d335ca403d2e2b4dd2ac3d4331.
---
 libavformat/concatdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

wm4 May 22, 2017, 3:11 p.m. UTC | #1
On Mon, 22 May 2017 16:54:31 +0200
Clément Bœsch <u@pkh.me> wrote:

> From: Clément Bœsch <cboesch@gopro.com>
> 
> If the source is using a custom IO, setting this flag causes heavy leaks
> since the segments will not have their avio context closed.
> 
> Regression since f5da453b068f55d335ca403d2e2b4dd2ac3d4331.
> ---
>  libavformat/concatdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
> index 73f8a63a2b..e57e5ce0ec 100644
> --- a/libavformat/concatdec.c
> +++ b/libavformat/concatdec.c
> @@ -324,7 +324,7 @@ static int open_file(AVFormatContext *avf, unsigned fileno)
>      if (!cat->avf)
>          return AVERROR(ENOMEM);
>  
> -    cat->avf->flags |= avf->flags;
> +    cat->avf->flags |= avf->flags & ~AVFMT_FLAG_CUSTOM_IO;
>      cat->avf->interrupt_callback = avf->interrupt_callback;
>  
>      if ((ret = ff_copy_whiteblacklists(cat->avf, avf)) < 0)

Yeah, that would be unintended. The intention was to pass down the flag
to disable side data packet merging.

HLS had the same change and should probably be fixed.
Clément Bœsch May 22, 2017, 3:51 p.m. UTC | #2
On Mon, May 22, 2017 at 05:11:34PM +0200, wm4 wrote:
> On Mon, 22 May 2017 16:54:31 +0200
> Clément Bœsch <u@pkh.me> wrote:
> 
> > From: Clément Bœsch <cboesch@gopro.com>
> > 
> > If the source is using a custom IO, setting this flag causes heavy leaks
> > since the segments will not have their avio context closed.
> > 
> > Regression since f5da453b068f55d335ca403d2e2b4dd2ac3d4331.
> > ---
> >  libavformat/concatdec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
> > index 73f8a63a2b..e57e5ce0ec 100644
> > --- a/libavformat/concatdec.c
> > +++ b/libavformat/concatdec.c
> > @@ -324,7 +324,7 @@ static int open_file(AVFormatContext *avf, unsigned fileno)
> >      if (!cat->avf)
> >          return AVERROR(ENOMEM);
> >  
> > -    cat->avf->flags |= avf->flags;
> > +    cat->avf->flags |= avf->flags & ~AVFMT_FLAG_CUSTOM_IO;
> >      cat->avf->interrupt_callback = avf->interrupt_callback;
> >  
> >      if ((ret = ff_copy_whiteblacklists(cat->avf, avf)) < 0)
> 
> Yeah, that would be unintended. The intention was to pass down the flag
> to disable side data packet merging.
> 
> HLS had the same change and should probably be fixed.

Done the same for HLS and pushed.

Thanks
diff mbox

Patch

diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index 73f8a63a2b..e57e5ce0ec 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -324,7 +324,7 @@  static int open_file(AVFormatContext *avf, unsigned fileno)
     if (!cat->avf)
         return AVERROR(ENOMEM);
 
-    cat->avf->flags |= avf->flags;
+    cat->avf->flags |= avf->flags & ~AVFMT_FLAG_CUSTOM_IO;
     cat->avf->interrupt_callback = avf->interrupt_callback;
 
     if ((ret = ff_copy_whiteblacklists(cat->avf, avf)) < 0)