[FFmpeg-cvslog] replace remaining usage of deprecated av_metadata_set2() by av_dict_set()

Aurelien Jacobs git at videolan.org
Mon Jun 13 19:02:06 CEST 2011


ffmpeg | branch: master | Aurelien Jacobs <aurel at gnuage.org> | Mon Jun 13 19:02:50 2011 +0200| [e6ba3d428105edbd3c1a468ece619f801151eea2] | committer: Aurelien Jacobs

replace remaining usage of deprecated av_metadata_set2() by av_dict_set()

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e6ba3d428105edbd3c1a468ece619f801151eea2
---

 libavformat/aiffdec.c     |    2 +-
 libavformat/matroskadec.c |    6 +++---
 libavformat/mov.c         |    2 +-
 libavformat/wav.c         |   10 +++++-----
 libavformat/wtvdec.c      |    6 +++---
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 21f28e3..9608910 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -78,7 +78,7 @@ static void get_meta(AVFormatContext *s, const char *key, int size)
         }
         size += (size&1)-res;
         str[res] = 0;
-        av_metadata_set2(&s->metadata, key, str, AV_METADATA_DONT_STRDUP_VAL);
+        av_dict_set(&s->metadata, key, str, AV_METADATA_DONT_STRDUP_VAL);
     }else
         size+= size&1;
 
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 8fafbb3..bd71bef 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1515,7 +1515,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
 
             /* export stereo mode flag as metadata tag */
             if (track->video.stereo_mode && track->video.stereo_mode < MATROSKA_VIDEO_STEREO_MODE_COUNT)
-                av_metadata_set2(&st->metadata, "stereo_mode", matroska_video_stereo_mode[track->video.stereo_mode], 0);
+                av_dict_set(&st->metadata, "stereo_mode", matroska_video_stereo_mode[track->video.stereo_mode], 0);
 
             /* if we have virtual track, mark the real tracks */
             for (j=0; j < track->operation.combine_planes.nb_elem; j++) {
@@ -1526,8 +1526,8 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
                          matroska_video_stereo_plane[planes[j].type], i);
                 for (k=0; k < matroska->tracks.nb_elem; k++)
                     if (planes[j].uid == tracks[k].uid) {
-                        av_metadata_set2(&s->streams[k]->metadata,
-                                         "stereo_mode", buf, 0);
+                        av_dict_set(&s->streams[k]->metadata,
+                                    "stereo_mode", buf, 0);
                         break;
                     }
             }
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 6a49f37..088df2c 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1928,7 +1928,7 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     sc->height = height >> 16;
 
     if (display_matrix[0][0] == -65536 && display_matrix[1][1] == -65536) {
-         av_metadata_set2(&st->metadata, "rotate", "180", 0);
+         av_dict_set(&st->metadata, "rotate", "180", 0);
     }
 
     // transform the display width/height according to the matrix
diff --git a/libavformat/wav.c b/libavformat/wav.c
index 5c4b7d3..c5dbd63 100644
--- a/libavformat/wav.c
+++ b/libavformat/wav.c
@@ -216,7 +216,7 @@ static inline int wav_parse_bext_string(AVFormatContext *s, const char *key, int
     temp[length] = 0;
 
     if (strlen(temp))
-        return av_metadata_set2(&s->metadata, key, temp, 0);
+        return av_dict_set(&s->metadata, key, temp, 0);
 
     return 0;
 }
@@ -237,7 +237,7 @@ static int wav_parse_bext_tag(AVFormatContext *s, int64_t size)
 
     time_reference = avio_rl64(s->pb);
     snprintf(temp, sizeof(temp), "%"PRIu64, time_reference);
-    if ((ret = av_metadata_set2(&s->metadata, "time_reference", temp, 0)) < 0)
+    if ((ret = av_dict_set(&s->metadata, "time_reference", temp, 0)) < 0)
         return ret;
 
     /* check if version is >= 1, in which case an UMID may be present */
@@ -259,7 +259,7 @@ static int wav_parse_bext_tag(AVFormatContext *s, int64_t size)
                          umid_parts[4], umid_parts[5], umid_parts[6], umid_parts[7]);
             }
 
-            if ((ret = av_metadata_set2(&s->metadata, "umid", temp, 0)) < 0)
+            if ((ret = av_dict_set(&s->metadata, "umid", temp, 0)) < 0)
                 return ret;
         }
 
@@ -278,8 +278,8 @@ static int wav_parse_bext_tag(AVFormatContext *s, int64_t size)
             return ret;
 
         coding_history[size] = 0;
-        if ((ret = av_metadata_set2(&s->metadata, "coding_history", coding_history,
-                                    AV_METADATA_DONT_STRDUP_VAL)) < 0)
+        if ((ret = av_dict_set(&s->metadata, "coding_history", coding_history,
+                               AV_METADATA_DONT_STRDUP_VAL)) < 0)
             return ret;
     }
 
diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index 5cbec05..5fe7e9f 100644
--- a/libavformat/wtvdec.c
+++ b/libavformat/wtvdec.c
@@ -431,7 +431,7 @@ static void get_attachment(AVFormatContext *s, AVIOContext *pb, int length)
     st = av_new_stream(s, 0);
     if (!st)
         goto done;
-    av_metadata_set2(&st->metadata, "title", description, 0);
+    av_dict_set(&st->metadata, "title", description, 0);
     st->codec->codec_id   = CODEC_ID_MJPEG;
     st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT;
     st->codec->extradata  = av_mallocz(filesize);
@@ -494,7 +494,7 @@ static void get_tag(AVFormatContext *s, AVIOContext *pb, const char *key, int ty
         return;
     }
 
-    av_metadata_set2(&s->metadata, key, buf, 0);
+    av_dict_set(&s->metadata, key, buf, 0);
     av_freep(&buf);
 }
 
@@ -818,7 +818,7 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
                 avio_read(pb, language, 3);
                 if (language[0]) {
                     language[3] = 0;
-                    av_metadata_set2(&st->metadata, "language", language, 0);
+                    av_dict_set(&st->metadata, "language", language, 0);
                     if (!strcmp(language, "nar") || !strcmp(language, "NAR"))
                         st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED;
                 }



More information about the ffmpeg-cvslog mailing list