Commit 38766e08 authored by Aurelien Jacobs's avatar Aurelien Jacobs

matroskadec: export track name through the metadata API

Originally committed as revision 17329 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 6cb6e159
...@@ -129,6 +129,7 @@ typedef struct { ...@@ -129,6 +129,7 @@ typedef struct {
typedef struct { typedef struct {
uint64_t num; uint64_t num;
uint64_t type; uint64_t type;
char *name;
char *codec_id; char *codec_id;
EbmlBin codec_priv; EbmlBin codec_priv;
char *language; char *language;
...@@ -303,6 +304,7 @@ static EbmlSyntax matroska_track_encodings[] = { ...@@ -303,6 +304,7 @@ static EbmlSyntax matroska_track_encodings[] = {
static EbmlSyntax matroska_track[] = { static EbmlSyntax matroska_track[] = {
{ MATROSKA_ID_TRACKNUMBER, EBML_UINT, 0, offsetof(MatroskaTrack,num) }, { 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_TRACKTYPE, EBML_UINT, 0, offsetof(MatroskaTrack,type) },
{ MATROSKA_ID_CODECID, EBML_STR, 0, offsetof(MatroskaTrack,codec_id) }, { MATROSKA_ID_CODECID, EBML_STR, 0, offsetof(MatroskaTrack,codec_id) },
{ MATROSKA_ID_CODECPRIVATE, EBML_BIN, 0, offsetof(MatroskaTrack,codec_priv) }, { MATROSKA_ID_CODECPRIVATE, EBML_BIN, 0, offsetof(MatroskaTrack,codec_priv) },
...@@ -314,7 +316,6 @@ static EbmlSyntax matroska_track[] = { ...@@ -314,7 +316,6 @@ static EbmlSyntax matroska_track[] = {
{ MATROSKA_ID_TRACKAUDIO, EBML_NEST, 0, offsetof(MatroskaTrack,audio), {.n=matroska_track_audio} }, { 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_TRACKCONTENTENCODINGS,EBML_NEST, 0, 0, {.n=matroska_track_encodings} },
{ MATROSKA_ID_TRACKUID, EBML_NONE }, { MATROSKA_ID_TRACKUID, EBML_NONE },
{ MATROSKA_ID_TRACKNAME, EBML_NONE },
{ MATROSKA_ID_TRACKFLAGENABLED, EBML_NONE }, { MATROSKA_ID_TRACKFLAGENABLED, EBML_NONE },
{ MATROSKA_ID_TRACKFLAGFORCED, EBML_NONE }, { MATROSKA_ID_TRACKFLAGFORCED, EBML_NONE },
{ MATROSKA_ID_TRACKFLAGLACING, EBML_NONE }, { MATROSKA_ID_TRACKFLAGLACING, EBML_NONE },
...@@ -1295,6 +1296,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -1295,6 +1296,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->start_time = 0; st->start_time = 0;
if (strcmp(track->language, "und")) if (strcmp(track->language, "und"))
av_metadata_set(&st->metadata, "language", track->language); av_metadata_set(&st->metadata, "language", track->language);
av_metadata_set(&st->metadata, "description", track->name);
if (track->flag_default) if (track->flag_default)
st->disposition |= AV_DISPOSITION_DEFAULT; st->disposition |= AV_DISPOSITION_DEFAULT;
......
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