lavfi/metadata: fix metadata deletion if comparison returns false
authorMarton Balint <cus@passwd.hu>
Thu, 6 Oct 2016 21:43:03 +0000 (23:43 +0200)
committerMarton Balint <cus@passwd.hu>
Tue, 11 Oct 2016 16:05:28 +0000 (18:05 +0200)
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
libavfilter/f_metadata.c

index f4a929c..f2c71d9 100644 (file)
@@ -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);