Commit d7bb185f authored by Justin Ruggles's avatar Justin Ruggles

Add a VorbisComment metadata conversion table and use it in the FLAC and

Ogg demuxers.

Originally committed as revision 19186 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 7ca12959
...@@ -146,4 +146,5 @@ AVInputFormat flac_demuxer = { ...@@ -146,4 +146,5 @@ AVInputFormat flac_demuxer = {
.flags= AVFMT_GENERIC_INDEX, .flags= AVFMT_GENERIC_INDEX,
.extensions = "flac", .extensions = "flac",
.value = CODEC_ID_FLAC, .value = CODEC_ID_FLAC,
.metadata_conv = ff_vorbiscomment_metadata_conv,
}; };
...@@ -583,4 +583,5 @@ AVInputFormat ogg_demuxer = { ...@@ -583,4 +583,5 @@ AVInputFormat ogg_demuxer = {
NULL, NULL,
ogg_read_timestamp, ogg_read_timestamp,
.extensions = "ogg", .extensions = "ogg",
.metadata_conv = ff_vorbiscomment_metadata_conv,
}; };
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#define AVFORMAT_OGGDEC_H #define AVFORMAT_OGGDEC_H
#include "avformat.h" #include "avformat.h"
#include "metadata.h"
struct ogg_codec { struct ogg_codec {
const int8_t *magic; const int8_t *magic;
...@@ -91,6 +92,8 @@ extern const struct ogg_codec ff_speex_codec; ...@@ -91,6 +92,8 @@ extern const struct ogg_codec ff_speex_codec;
extern const struct ogg_codec ff_theora_codec; extern const struct ogg_codec ff_theora_codec;
extern const struct ogg_codec ff_vorbis_codec; extern const struct ogg_codec ff_vorbis_codec;
extern const AVMetadataConv ff_vorbiscomment_metadata_conv[];
int vorbis_comment(AVFormatContext *ms, uint8_t *buf, int size); int vorbis_comment(AVFormatContext *ms, uint8_t *buf, int size);
#endif /* AVFORMAT_OGGDEC_H */ #endif /* AVFORMAT_OGGDEC_H */
...@@ -30,6 +30,21 @@ ...@@ -30,6 +30,21 @@
#include "avformat.h" #include "avformat.h"
#include "oggdec.h" #include "oggdec.h"
/**
* VorbisComment metadata conversion mapping.
* from Ogg Vorbis I format specification: comment field and header specification
* http://xiph.org/vorbis/doc/v-comment.html
*/
const AVMetadataConv ff_vorbiscomment_metadata_conv[] = {
{ "ARTIST" , "author" },
{ "TITLE" , "title" },
{ "ALBUM" , "album" },
{ "DATE" , "year" },
{ "TRACKNUMBER", "track" },
{ "GENRE" , "genre" },
{ 0 }
};
int int
vorbis_comment(AVFormatContext * as, uint8_t *buf, int size) vorbis_comment(AVFormatContext * as, uint8_t *buf, int size)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment