static int asf_probe(AVProbeData *pd)
{
/* check file header */
- if (pd->buf_size <= 32)
- return 0;
-
if (!memcmp(pd->buf, &asf_header, sizeof(GUID)))
return AVPROBE_SCORE_MAX;
else
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);
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);
st->codec->codec_type = type;
if (type == CODEC_TYPE_AUDIO) {
get_wav_header(pb, st->codec, type_specific_size);
- st->need_parsing = 1;
+ 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 = AVSTREAM_PARSE_FULL;
/* We have to init the frame size at some point .... */
pos2 = url_ftell(pb);
if (gsize >= (pos2 + 8 - pos1 + 24)) {
st->codec->codec_tag = tag1;
st->codec->codec_id = codec_get_id(codec_bmp_tags, tag1);
if(tag1 == MKTAG('D', 'V', 'R', ' '))
- st->need_parsing = 1;
+ st->need_parsing = AVSTREAM_PARSE_FULL;
}
pos2 = url_ftell(pb);
url_fskip(pb, gsize - (pos2 - pos1 + 24));