changeset 6375:256e51c4f44b libavformat

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>.
author rbultje
date Fri, 13 Aug 2010 17:08:57 +0000
parents 697815446a12
children 91076395b8d3
files mms.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mms.c	Fri Aug 13 17:02:37 2010 +0000
+++ b/mms.c	Fri Aug 13 17:08:57 2010 +0000
@@ -68,7 +68,12 @@
 
     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",