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

Marton Balint cus at passwd.hu
Fri Oct 7 00:49:06 EEST 2016


Signed-off-by: Marton Balint <cus at passwd.hu>
---
 libavfilter/f_metadata.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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



More information about the ffmpeg-devel mailing list