diff mbox

[FFmpeg-devel] lavfi/metadata: fix metadata deletion if comparison returns false

Message ID 1475790546-16416-1-git-send-email-cus@passwd.hu
State Accepted
Commit 24022402be4cf3311c673b9a9096081e263b91e2
Headers show

Commit Message

Marton Balint Oct. 6, 2016, 9:49 p.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavfilter/f_metadata.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Michael Niedermayer Oct. 7, 2016, 8:18 p.m. UTC | #1
On Thu, Oct 06, 2016 at 11:49:06PM +0200, Marton Balint wrote:
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
>  libavfilter/f_metadata.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

should be ok if paul has no comment/time

thx

[...]
Paul B Mahol Oct. 8, 2016, 8:48 a.m. UTC | #2
On 10/6/16, Marton Balint <cus@passwd.hu> wrote:
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
>  libavfilter/f_metadata.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>

lgtm
Marton Balint Oct. 11, 2016, 4:24 p.m. UTC | #3
On Sat, 8 Oct 2016, Paul B Mahol wrote:

> On 10/6/16, Marton Balint <cus@passwd.hu> wrote:
>> Signed-off-by: Marton Balint <cus@passwd.hu>
>> ---
>>  libavfilter/f_metadata.c | 4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>
>
> lgtm

Thanks, applied.

Regards,
Marton
diff mbox

Patch

diff --git a/libavfilter/f_metadata.c b/libavfilter/f_metadata.c
index f4a929c..f2c71d9 100644
--- a/libavfilter/f_metadata.c
+++ b/libavfilter/f_metadata.c
@@ -330,9 +330,7 @@  static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
     case METADATA_DELETE:
         if (!s->key) {
             av_dict_free(metadata);
-        } else if (e && e->value && s->value && s->compare(s, e->value, s->value)) {
-            av_dict_set(metadata, s->key, NULL, 0);
-        } else if (e && e->value) {
+        } else if (e && e->value && (!s->value || s->compare(s, e->value, s->value))) {
             av_dict_set(metadata, s->key, NULL, 0);
         }
         return ff_filter_frame(outlink, frame);