[FFmpeg-devel] [PATCH] avfilter/f_metadata: do not return the frame early if there is no metadata

Marton Balint cus at passwd.hu
Wed Jun 23 03:41:59 EEST 2021


The early return caused isses for the "add" mode (got fixed in
c95dfe5cce98cde3e7fb14fbd04b3897f3927cec) and the "select" mode needs a similar
fix. It is probably better to fully remove the check, since all modes work
correctly with NULL metadata.

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

diff --git a/libavfilter/f_metadata.c b/libavfilter/f_metadata.c
index e7c7b00118..d0a78b00d0 100644
--- a/libavfilter/f_metadata.c
+++ b/libavfilter/f_metadata.c
@@ -308,9 +308,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
     AVDictionary **metadata = &frame->metadata;
     AVDictionaryEntry *e;
 
-    if (!*metadata && s->mode != METADATA_ADD)
-        return ff_filter_frame(outlink, frame);
-
     e = av_dict_get(*metadata, !s->key ? "" : s->key, NULL,
                     !s->key ? AV_DICT_IGNORE_SUFFIX: 0);
 
-- 
2.26.2



More information about the ffmpeg-devel mailing list