[FFmpeg-devel] [PATCH 1/2] lavfi/metadata: fix setting metadata values

Marton Balint cus at passwd.hu
Sat Oct 1 15:53:55 EEST 2016


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

diff --git a/libavfilter/f_metadata.c b/libavfilter/f_metadata.c
index 188f0b6..1fe713c 100644
--- a/libavfilter/f_metadata.c
+++ b/libavfilter/f_metadata.c
@@ -280,13 +280,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
     AVFilterContext *ctx = inlink->dst;
     AVFilterLink *outlink = ctx->outputs[0];
     MetadataContext *s = ctx->priv;
-    AVDictionary *metadata = av_frame_get_metadata(frame);
+    AVDictionary **metadata = avpriv_frame_get_metadatap(frame);
     AVDictionaryEntry *e;
 
-    if (!metadata)
+    if (!*metadata)
         return ff_filter_frame(outlink, frame);
 
-    e = av_dict_get(metadata, !s->key ? "" : s->key, NULL,
+    e = av_dict_get(*metadata, !s->key ? "" : s->key, NULL,
                     !s->key ? AV_DICT_IGNORE_SUFFIX: 0);
 
     switch (s->mode) {
@@ -302,13 +302,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
         if (e && e->value) {
             ;
         } else {
-            av_dict_set(&metadata, s->key, s->value, 0);
+            av_dict_set(metadata, s->key, s->value, 0);
         }
         return ff_filter_frame(outlink, frame);
         break;
     case METADATA_MODIFY:
         if (e && e->value) {
-            av_dict_set(&metadata, s->key, s->value, 0);
+            av_dict_set(metadata, s->key, s->value, 0);
         }
         return ff_filter_frame(outlink, frame);
         break;
@@ -317,7 +317,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
             s->print(ctx, "frame:%-4"PRId64" pts:%-7s pts_time:%-7s\n",
                      inlink->frame_count, av_ts2str(frame->pts), av_ts2timestr(frame->pts, &inlink->time_base));
             s->print(ctx, "%s=%s\n", e->key, e->value);
-            while ((e = av_dict_get(metadata, "", e, AV_DICT_IGNORE_SUFFIX)) != NULL) {
+            while ((e = av_dict_get(*metadata, "", e, AV_DICT_IGNORE_SUFFIX)) != NULL) {
                 s->print(ctx, "%s=%s\n", e->key, e->value);
             }
         } else if (e && e->value && (!s->value || (e->value && s->compare(s, e->value, s->value)))) {
@@ -329,9 +329,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
         break;
     case METADATA_DELETE:
         if (e && e->value && s->value && s->compare(s, e->value, s->value)) {
-            av_dict_set(&metadata, s->key, NULL, 0);
+            av_dict_set(metadata, s->key, NULL, 0);
         } else if (e && e->value) {
-            av_dict_set(&metadata, s->key, NULL, 0);
+            av_dict_set(metadata, s->key, NULL, 0);
         }
         return ff_filter_frame(outlink, frame);
         break;
-- 
2.6.6



More information about the ffmpeg-devel mailing list