changeset 5236:1403c88b1ce7 libavformat

Add id3v2 metadata conversion table and use it in mp3 muxer. Patch by Anton Khirnov, wyskas gmail
author cehoyos
date Tue, 29 Sep 2009 07:05:03 +0000
parents bf1b8e6b3a84
children 496723640f94
files id3v2.c id3v2.h mp3.c
diffstat 3 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/id3v2.c	Sat Sep 26 21:06:18 2009 +0000
+++ b/id3v2.c	Tue Sep 29 07:05:03 2009 +0000
@@ -242,3 +242,22 @@
     av_log(s, AV_LOG_INFO, "ID3v2.%d tag skipped, cannot handle %s\n", version, reason);
     url_fskip(s->pb, len);
 }
+
+const AVMetadataConv ff_id3v2_metadata_conv[] = {
+    { "TALB", "album"},
+    { "TCOM", "composer"},
+    { "TCON", "genre"},
+    { "TCOP", "copyright"},
+    { "TDRL", "date"},
+    { "TENC", "encoder"},
+    { "TIT2", "title"},
+    { "TLAN", "language"},
+    { "TPE1", "author"},
+    { "TPOS", "disc"},
+    { "TPUB", "publisher"},
+    { "TRCK", "track"},
+    { "TSOA", "albumsort"},
+    { "TSOP", "authorsort"},
+    { "TSOT", "titlesort"},
+    { 0 }
+};
--- a/id3v2.h	Sat Sep 26 21:06:18 2009 +0000
+++ b/id3v2.h	Tue Sep 29 07:05:03 2009 +0000
@@ -24,6 +24,7 @@
 
 #include <stdint.h>
 #include "avformat.h"
+#include "metadata.h"
 
 #define ID3v2_HEADER_SIZE 10
 
@@ -51,4 +52,6 @@
  */
 void ff_id3v2_read(AVFormatContext *s);
 
+extern const AVMetadataConv ff_id3v2_metadata_conv[];
+
 #endif /* AVFORMAT_ID3V2_H */
--- a/mp3.c	Sat Sep 26 21:06:18 2009 +0000
+++ b/mp3.c	Tue Sep 29 07:05:03 2009 +0000
@@ -341,5 +341,6 @@
     mp3_write_header,
     mp3_write_packet,
     mp3_write_trailer,
+    .metadata_conv = ff_id3v2_metadata_conv,
 };
 #endif