Message ID | 20200317213147.1140-1-andreas.rheinhardt@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | [FFmpeg-devel,1/2] avcodec/bsf: Don't set defaults for AVClass without options | expand |
Context | Check | Description |
---|---|---|
andriy/ffmpeg-patchwork | success | Make fate finished |
Quoting Andreas Rheinhardt (2020-03-17 22:31:46) > This happened for AVBSFContext. > > Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> > --- Maybe ok. Not sure if it's better to drop it because it's unused or keep it in case someone adds options later.
Anton Khirnov: > Quoting Andreas Rheinhardt (2020-03-17 22:31:46) >> This happened for AVBSFContext. >> >> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> >> --- > Maybe ok. Not sure if it's better to drop it because it's unused or keep > it in case someone adds options later. > My opinion is that whoever adds the first option should add the av_opt_set_default()/av_opt_free(), hence this patch. - Andreas
Quoting Andreas Rheinhardt (2020-03-18 17:10:37) > Anton Khirnov: > > Quoting Andreas Rheinhardt (2020-03-17 22:31:46) > >> This happened for AVBSFContext. > >> > >> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> > >> --- > > Maybe ok. Not sure if it's better to drop it because it's unused or keep > > it in case someone adds options later. > > > My opinion is that whoever adds the first option should add the > av_opt_set_default()/av_opt_free(), hence this patch. Okay, go ahead then.
On 3/20/2020 5:17 AM, Anton Khirnov wrote: > Quoting Andreas Rheinhardt (2020-03-18 17:10:37) >> Anton Khirnov: >>> Quoting Andreas Rheinhardt (2020-03-17 22:31:46) >>>> This happened for AVBSFContext. >>>> >>>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> >>>> --- >>> Maybe ok. Not sure if it's better to drop it because it's unused or keep >>> it in case someone adds options later. >>> >> My opinion is that whoever adds the first option should add the >> av_opt_set_default()/av_opt_free(), hence this patch. > > Okay, go ahead then. Applied.
diff --git a/libavcodec/bsf.c b/libavcodec/bsf.c index 9dbf6a636d..d0e0d46068 100644 --- a/libavcodec/bsf.c +++ b/libavcodec/bsf.c @@ -45,8 +45,6 @@ void av_bsf_free(AVBSFContext **pctx) if (ctx->filter->priv_class && ctx->priv_data) av_opt_free(ctx->priv_data); - av_opt_free(ctx); - if (ctx->internal) av_packet_free(&ctx->internal->buffer_pkt); av_freep(&ctx->internal); @@ -112,8 +110,6 @@ int av_bsf_alloc(const AVBitStreamFilter *filter, AVBSFContext **pctx) goto fail; } - av_opt_set_defaults(ctx); - /* allocate priv data and init private options */ if (filter->priv_data_size) { ctx->priv_data = av_mallocz(filter->priv_data_size);
This happened for AVBSFContext. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> --- libavcodec/bsf.c | 4 ---- 1 file changed, 4 deletions(-)