summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/id3v2.c19
-rw-r--r--libavformat/id3v2.h3
-rw-r--r--libavformat/mp3.c1
3 files changed, 23 insertions, 0 deletions
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index dedc0450b3..651c8fc613 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -242,3 +242,22 @@ void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t flags)
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 }
+};
diff --git a/libavformat/id3v2.h b/libavformat/id3v2.h
index 791c00c595..3e981a439a 100644
--- a/libavformat/id3v2.h
+++ b/libavformat/id3v2.h
@@ -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_parse(AVFormatContext *s, int len, uint8_t version, uint8_t flags)
*/
void ff_id3v2_read(AVFormatContext *s);
+extern const AVMetadataConv ff_id3v2_metadata_conv[];
+
#endif /* AVFORMAT_ID3V2_H */
diff --git a/libavformat/mp3.c b/libavformat/mp3.c
index ab57227c71..42ca42fa08 100644
--- a/libavformat/mp3.c
+++ b/libavformat/mp3.c
@@ -341,5 +341,6 @@ AVOutputFormat mp3_muxer = {
mp3_write_header,
mp3_write_packet,
mp3_write_trailer,
+ .metadata_conv = ff_id3v2_metadata_conv,
};
#endif