aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2009-02-15 15:29:09 +0000
committerAurelien Jacobs <aurel@gnuage.org>2009-02-15 15:29:09 +0000
commit38766e084f28f3515598720665507ca54eccddae (patch)
treef5c51bea215eb20e0cf787c404acffc292e4460d
parent6cb6e159f886f3b2fe5986e048cd13f153bf9c3d (diff)
downloadffmpeg-38766e084f28f3515598720665507ca54eccddae.tar.gz
matroskadec: export track name through the metadata API
Originally committed as revision 17329 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/matroskadec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index c938a1ddd6..493a30070e 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -129,6 +129,7 @@ typedef struct {
typedef struct {
uint64_t num;
uint64_t type;
+ char *name;
char *codec_id;
EbmlBin codec_priv;
char *language;
@@ -303,6 +304,7 @@ static EbmlSyntax matroska_track_encodings[] = {
static EbmlSyntax matroska_track[] = {
{ MATROSKA_ID_TRACKNUMBER, EBML_UINT, 0, offsetof(MatroskaTrack,num) },
+ { MATROSKA_ID_TRACKNAME, EBML_UTF8, 0, offsetof(MatroskaTrack,name) },
{ MATROSKA_ID_TRACKTYPE, EBML_UINT, 0, offsetof(MatroskaTrack,type) },
{ MATROSKA_ID_CODECID, EBML_STR, 0, offsetof(MatroskaTrack,codec_id) },
{ MATROSKA_ID_CODECPRIVATE, EBML_BIN, 0, offsetof(MatroskaTrack,codec_priv) },
@@ -314,7 +316,6 @@ static EbmlSyntax matroska_track[] = {
{ MATROSKA_ID_TRACKAUDIO, EBML_NEST, 0, offsetof(MatroskaTrack,audio), {.n=matroska_track_audio} },
{ MATROSKA_ID_TRACKCONTENTENCODINGS,EBML_NEST, 0, 0, {.n=matroska_track_encodings} },
{ MATROSKA_ID_TRACKUID, EBML_NONE },
- { MATROSKA_ID_TRACKNAME, EBML_NONE },
{ MATROSKA_ID_TRACKFLAGENABLED, EBML_NONE },
{ MATROSKA_ID_TRACKFLAGFORCED, EBML_NONE },
{ MATROSKA_ID_TRACKFLAGLACING, EBML_NONE },
@@ -1295,6 +1296,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->start_time = 0;
if (strcmp(track->language, "und"))
av_metadata_set(&st->metadata, "language", track->language);
+ av_metadata_set(&st->metadata, "description", track->name);
if (track->flag_default)
st->disposition |= AV_DISPOSITION_DEFAULT;