summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhentan Feng <spyfeng@gmail.com>2010-08-13 17:08:57 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2010-08-13 17:08:57 +0000
commitc46000c1ff570f30f2255dcb42950b464a219a3d (patch)
tree64eee29bae390b42370a6d47442d9c17bf158105
parent99ab8ff049ebbd2807a69ca2154a72bface51c2e (diff)
Set fixed chunksize for ASF header in MMS streams, as per MSDN documentation.
This fixes playback of at least one MMST stream. Patch by Zhentan Feng <spyfeng gmail com>. Originally committed as revision 24793 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/mms.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/mms.c b/libavformat/mms.c
index 5afa077ccd..cbb4739aca 100644
--- a/libavformat/mms.c
+++ b/libavformat/mms.c
@@ -68,7 +68,12 @@ int ff_mms_asf_header_parser(MMSContext *mms)
p += sizeof(ff_asf_guid) + 14;
while(end - p >= sizeof(ff_asf_guid) + 8) {
- uint64_t chunksize = AV_RL64(p + sizeof(ff_asf_guid));
+ uint64_t chunksize;
+ if (!memcmp(p, ff_asf_data_header, sizeof(ff_asf_guid))) {
+ chunksize = 50; // see Reference [2] section 5.1
+ } else {
+ chunksize = AV_RL64(p + sizeof(ff_asf_guid));
+ }
if (!chunksize || chunksize > end - p) {
av_log(NULL, AV_LOG_ERROR,
"Corrupt stream (header chunksize %"PRId64" is invalid)\n",