diff mbox

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

Message ID 1475326436-17647-1-git-send-email-cus@passwd.hu
State Accepted
Commit d946424f193391e37c034ceb2c72203309904e30
Headers show

Commit Message

Marton Balint Oct. 1, 2016, 12:53 p.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavfilter/f_metadata.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Paul B Mahol Oct. 1, 2016, 1:46 p.m. UTC | #1
On 10/1/16, Marton Balint <cus@passwd.hu> wrote:
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
>  libavfilter/f_metadata.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>

lgtm
Marton Balint Oct. 1, 2016, 3:39 p.m. UTC | #2
On Sat, 1 Oct 2016, Paul B Mahol wrote:

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

Pushed, thanks.

Marton
diff mbox

Patch

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;