From 5ccedb2a38c62ae41dbdbe2ec26d6696db2c7a63 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 29 Oct 2009 10:34:17 -0700 Subject: [PATCH] asfdemux: accept fragments in a continued packet where the subsequent fragments declare a size of 0. Fixes bug 600037. --- gst/asfdemux/asfpacket.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gst/asfdemux/asfpacket.c b/gst/asfdemux/asfpacket.c index 38eb663940..0a17acb797 100644 --- a/gst/asfdemux/asfpacket.c +++ b/gst/asfdemux/asfpacket.c @@ -101,8 +101,16 @@ asf_payload_find_previous_fragment (AsfPayload * payload, AsfStream * stream) if (G_UNLIKELY (ret->mo_size != payload->mo_size || ret->mo_number != payload->mo_number || ret->mo_offset != 0)) { - GST_WARNING ("Previous fragment does not match continued fragment"); - return NULL; + if (payload->mo_size != 0) { + GST_WARNING ("Previous fragment does not match continued fragment"); + return NULL; + } else { + // Warn about this case, but accept it anyway: files in the wild sometimes + // have continued packets where the subsequent fragments say that they're + // zero-sized. + GST_WARNING ("Previous fragment found, but current fragment has " + "zero size, accepting anyway"); + } } #if 0 if (this_fragment->mo_offset + this_payload_len > first_fragment->mo_size) {