summaryrefslogtreecommitdiff
path: root/libavformat/asf.c
diff options
context:
space:
mode:
authorJohn Donaghy <johnfdonaghy@gmail.com>2007-04-12 08:11:33 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2007-04-12 08:11:33 +0000
commit6fea687ec1ff083d4da8e3bddf883163508cf48f (patch)
tree47b800bd62e6ab3db4bbd2a87c128bc7ee9ec55a /libavformat/asf.c
parentea7081737990e2b1aef8b2de9b6143698460991c (diff)
DVR-MS probe audio format
patch by John Donaghy \ johnfdonaghy chez gmail dot com / Original thread: date: 03/13/2007 04:56 PM subject: [Ffmpeg-devel] [PATCH] DVR-MS probe audio format - was DVR-MS bug (MP2 decoding) Originally committed as revision 8715 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/asf.c')
-rw-r--r--libavformat/asf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/asf.c b/libavformat/asf.c
index 5c67b7f259..9dce1d751a 100644
--- a/libavformat/asf.c
+++ b/libavformat/asf.c
@@ -195,7 +195,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
uint64_t total_size;
unsigned int tag1;
int64_t pos1, pos2;
- int test_for_ext_stream_audio;
+ int test_for_ext_stream_audio, is_dvr_ms_audio=0;
pos1 = url_ftell(pb);
@@ -241,6 +241,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
get_guid(pb, &g);
if (!memcmp(&g, &ext_stream_audio_stream, sizeof(GUID))) {
type = CODEC_TYPE_AUDIO;
+ is_dvr_ms_audio=1;
get_guid(pb, &g);
get_le32(pb);
get_le32(pb);
@@ -253,6 +254,12 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec->codec_type = type;
if (type == CODEC_TYPE_AUDIO) {
get_wav_header(pb, st->codec, type_specific_size);
+ if (is_dvr_ms_audio) {
+ // codec_id and codec_tag are unreliable in dvr_ms
+ // files. Set them later by probing stream.
+ st->codec->codec_id = CODEC_ID_NONE;
+ st->codec->codec_tag = 0;
+ }
st->need_parsing = 1;
/* We have to init the frame size at some point .... */
pos2 = url_ftell(pb);