Mercurial > libavformat.hg
comparison asf.c @ 2018:0d9b233dff9b libavformat
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)
author | benoit |
---|---|
date | Thu, 12 Apr 2007 08:11:33 +0000 |
parents | 1a3c9056982a |
children | a3e79d6e4e3c |
comparison
equal
deleted
inserted
replaced
2017:6c6eb1bac2f3 | 2018:0d9b233dff9b |
---|---|
193 } else if (!memcmp(&g, &stream_header, sizeof(GUID))) { | 193 } else if (!memcmp(&g, &stream_header, sizeof(GUID))) { |
194 int type, type_specific_size, sizeX; | 194 int type, type_specific_size, sizeX; |
195 uint64_t total_size; | 195 uint64_t total_size; |
196 unsigned int tag1; | 196 unsigned int tag1; |
197 int64_t pos1, pos2; | 197 int64_t pos1, pos2; |
198 int test_for_ext_stream_audio; | 198 int test_for_ext_stream_audio, is_dvr_ms_audio=0; |
199 | 199 |
200 pos1 = url_ftell(pb); | 200 pos1 = url_ftell(pb); |
201 | 201 |
202 st = av_new_stream(s, 0); | 202 st = av_new_stream(s, 0); |
203 if (!st) | 203 if (!st) |
239 | 239 |
240 if (test_for_ext_stream_audio) { | 240 if (test_for_ext_stream_audio) { |
241 get_guid(pb, &g); | 241 get_guid(pb, &g); |
242 if (!memcmp(&g, &ext_stream_audio_stream, sizeof(GUID))) { | 242 if (!memcmp(&g, &ext_stream_audio_stream, sizeof(GUID))) { |
243 type = CODEC_TYPE_AUDIO; | 243 type = CODEC_TYPE_AUDIO; |
244 is_dvr_ms_audio=1; | |
244 get_guid(pb, &g); | 245 get_guid(pb, &g); |
245 get_le32(pb); | 246 get_le32(pb); |
246 get_le32(pb); | 247 get_le32(pb); |
247 get_le32(pb); | 248 get_le32(pb); |
248 get_guid(pb, &g); | 249 get_guid(pb, &g); |
251 } | 252 } |
252 | 253 |
253 st->codec->codec_type = type; | 254 st->codec->codec_type = type; |
254 if (type == CODEC_TYPE_AUDIO) { | 255 if (type == CODEC_TYPE_AUDIO) { |
255 get_wav_header(pb, st->codec, type_specific_size); | 256 get_wav_header(pb, st->codec, type_specific_size); |
257 if (is_dvr_ms_audio) { | |
258 // codec_id and codec_tag are unreliable in dvr_ms | |
259 // files. Set them later by probing stream. | |
260 st->codec->codec_id = CODEC_ID_NONE; | |
261 st->codec->codec_tag = 0; | |
262 } | |
256 st->need_parsing = 1; | 263 st->need_parsing = 1; |
257 /* We have to init the frame size at some point .... */ | 264 /* We have to init the frame size at some point .... */ |
258 pos2 = url_ftell(pb); | 265 pos2 = url_ftell(pb); |
259 if (gsize >= (pos2 + 8 - pos1 + 24)) { | 266 if (gsize >= (pos2 + 8 - pos1 + 24)) { |
260 asf_st->ds_span = get_byte(pb); | 267 asf_st->ds_span = get_byte(pb); |