From 37c5d35177e3635e3eee16a11a71334cded58552 Mon Sep 17 00:00:00 2001
From: Arnaud Vrac <avrac@freebox.fr>
Date: Wed, 16 Jan 2013 19:13:20 +0100
Subject: qtdemux: hack to handle badly muxed files

The 'free' atom size just before 'mdat' is short of 8 bytes, so no data
is found. Try to resync in this case.

diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index ddd3fba..85f5fba 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -4142,6 +4142,12 @@ gst_qtdemux_chain (GstPad * sinkpad, GstObject * parent, GstBuffer * inbuf)
           ret = GST_FLOW_ERROR;
           break;
         }
+        if (fourcc == 0) {
+          /* fix some files with short free atom size */
+          demux->offset += 8;
+          gst_adapter_flush (demux->adapter, 8);
+          break;
+        }
         if (fourcc == FOURCC_mdat) {
           if (demux->n_streams > 0) {
             /* we have the headers, start playback */
-- 
1.7.10.4

