[FFmpeg-cvslog] Add metadata conversion table to the wav demuxer

Tomas Härdin git at videolan.org
Fri May 27 05:42:16 CEST 2011


ffmpeg | branch: master | Tomas Härdin <tomas.hardin at codemill.se> | Thu May 26 09:29:03 2011 +0200| [2660e9e1f398dbc8d447164a772b52281fa94a30] | committer: Michael Niedermayer

Add metadata conversion table to the wav demuxer

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/wav.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/libavformat/wav.c b/libavformat/wav.c
index baa7156..61261e6 100644
--- a/libavformat/wav.c
+++ b/libavformat/wav.c
@@ -26,6 +26,7 @@
 #include "avio_internal.h"
 #include "pcm.h"
 #include "riff.h"
+#include "metadata.h"
 
 typedef struct {
     int64_t data;
@@ -285,6 +286,14 @@ static int wav_parse_bext_tag(AVFormatContext *s, int64_t size)
     return 0;
 }
 
+static const AVMetadataConv wav_metadata_conv[] = {
+    {"description",      "comment"      },
+    {"originator",       "encoded_by"   },
+    {"origination_date", "date"         },
+    {"origination_time", "creation_time"},
+    {0},
+};
+
 /* wav input */
 static int wav_read_header(AVFormatContext *s,
                            AVFormatParameters *ap)
@@ -391,6 +400,9 @@ break_loop:
         sample_count = (data_size<<3) / (st->codec->channels * (uint64_t)av_get_bits_per_sample(st->codec->codec_id));
     if (sample_count)
         st->duration = sample_count;
+
+    ff_metadata_conv_ctx(s, NULL, wav_metadata_conv);
+
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list