diff mbox series

[FFmpeg-devel,1/2] avcodec/bsf: Don't set defaults for AVClass without options

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

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Andreas Rheinhardt March 17, 2020, 9:31 p.m. UTC
This happened for AVBSFContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/bsf.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Anton Khirnov March 18, 2020, 1:42 p.m. UTC | #1
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.
Andreas Rheinhardt March 18, 2020, 4:10 p.m. UTC | #2
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
Anton Khirnov March 20, 2020, 8:17 a.m. UTC | #3
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.
James Almer March 21, 2020, 9:54 p.m. UTC | #4
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 mbox series

Patch

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);