diff mbox series

[FFmpeg-devel] avfilter/f_metadata: correct check for existing metadata

Message ID 20200117101302.2077-1-ffmpeg@gyani.pro
State New
Headers show
Series [FFmpeg-devel] avfilter/f_metadata: correct check for existing metadata
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Gyan Doshi Jan. 17, 2020, 10:13 a.m. UTC
When adding metadata, existing dictionary need not be present.
---
 libavfilter/f_metadata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul B Mahol Jan. 17, 2020, 10:22 a.m. UTC | #1
OK if tested and works.

On 1/17/20, Gyan Doshi <ffmpeg@gyani.pro> wrote:
> When adding metadata, existing dictionary need not be present.
> ---
>  libavfilter/f_metadata.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavfilter/f_metadata.c b/libavfilter/f_metadata.c
> index bf298e9d39..598257b15b 100644
> --- a/libavfilter/f_metadata.c
> +++ b/libavfilter/f_metadata.c
> @@ -304,7 +304,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame
> *frame)
>      AVDictionary **metadata = &frame->metadata;
>      AVDictionaryEntry *e;
>
> -    if (!*metadata)
> +    if (!*metadata && s->mode != METADATA_ADD)
>          return ff_filter_frame(outlink, frame);
>
>      e = av_dict_get(*metadata, !s->key ? "" : s->key, NULL,
> --
> 2.24.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Gyan Doshi Jan. 17, 2020, 12:07 p.m. UTC | #2
On 17-01-2020 03:52 pm, Paul B Mahol wrote:
> OK if tested and works.

Tested. Pushed as c95dfe5cce98cde3e7fb14fbd04b3897f3927cec

Thanks,
Gyan

>
> On 1/17/20, Gyan Doshi <ffmpeg@gyani.pro> wrote:
>> When adding metadata, existing dictionary need not be present.
>> ---
>>   libavfilter/f_metadata.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavfilter/f_metadata.c b/libavfilter/f_metadata.c
>> index bf298e9d39..598257b15b 100644
>> --- a/libavfilter/f_metadata.c
>> +++ b/libavfilter/f_metadata.c
>> @@ -304,7 +304,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame
>> *frame)
>>       AVDictionary **metadata = &frame->metadata;
>>       AVDictionaryEntry *e;
>>
>> -    if (!*metadata)
>> +    if (!*metadata && s->mode != METADATA_ADD)
>>           return ff_filter_frame(outlink, frame);
>>
>>       e = av_dict_get(*metadata, !s->key ? "" : s->key, NULL,
>> --
>> 2.24.1
>>
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavfilter/f_metadata.c b/libavfilter/f_metadata.c
index bf298e9d39..598257b15b 100644
--- a/libavfilter/f_metadata.c
+++ b/libavfilter/f_metadata.c
@@ -304,7 +304,7 @@  static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
     AVDictionary **metadata = &frame->metadata;
     AVDictionaryEntry *e;
 
-    if (!*metadata)
+    if (!*metadata && s->mode != METADATA_ADD)
         return ff_filter_frame(outlink, frame);
 
     e = av_dict_get(*metadata, !s->key ? "" : s->key, NULL,