From d13431cd565e37e7e93667c18d78649cd538b237 Mon Sep 17 00:00:00 2001 From: Kevin Kuphal Date: Tue, 6 Jan 2004 15:31:36 +0000 Subject: [PATCH] ASF extended header parsing patch by ("Kevin Kuphal" ) Originally committed as revision 2672 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/asf.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/libavformat/asf.c b/libavformat/asf.c index 29310b5714..ca74f37e44 100644 --- a/libavformat/asf.c +++ b/libavformat/asf.c @@ -176,6 +176,10 @@ static const GUID head2_guid = { 0xabd3d211, 0xa9ba, 0x11cf, { 0x8e, 0xe6, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65 }, }; +static const GUID extended_content_header = { + 0xD2D0A440, 0xE307, 0x11D2, { 0x97, 0xF0, 0x00, 0xA0, 0xC9, 0x5E, 0xA8, 0x50 }, +}; + /* I am not a number !!! This GUID is the one found on the PC used to generate the stream */ static const GUID my_guid = { @@ -947,6 +951,38 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) get_str16_nolen(pb, len3, s->copyright, sizeof(s->copyright)); get_str16_nolen(pb, len4, s->comment, sizeof(s->comment)); url_fskip(pb, len5); + } else if (!memcmp(&g, &extended_content_header, sizeof(GUID))) { + int desc_count, i; + + desc_count = get_le16(pb); + for(i=0;ialbum, value); } + av_free(value); + } + if ((value_type >= 2) || (value_type <= 5)) // boolean or DWORD or QWORD or WORD + { + if (value_type==2) value_num = get_le32(pb); + if (value_type==3) value_num = get_le32(pb); + if (value_type==4) value_num = get_le64(pb); + if (value_type==5) value_num = get_le16(pb); + if (strcmp(name,"WM/Track")==0) s->track = value_num + 1; + if (strcmp(name,"WM/TrackNumber")==0) s->track = value_num; + } + av_free(name); + } #if 0 } else if (!memcmp(&g, &head1_guid, sizeof(GUID))) { int v1, v2;