qtdemux: When using a buffered mdat, store all received data for later use
authorThiago Santos <ts.santos@partner.samsung.com>
Fri, 25 Oct 2013 14:42:37 +0000 (11:42 -0300)
committerThiago Santos <ts.santos@partner.samsung.com>
Thu, 7 Nov 2013 14:22:03 +0000 (11:22 -0300)
commit0e78ffc9d61ffa0adca14be6e4214c8b08450b57
treeff99b8a25035cb466ace402f649b33e149108f3e
parentfd89e36c8a1f58f36f35e492bd2a9790f73fe211
qtdemux: When using a buffered mdat, store all received data for later use

In push mode, when qtdemux can't use a seek to skip the mdat buffer it has
to buffer it for later use.

The issue is that after parsing the next moov/moof, there might be some
trailing bytes from the next atom in the file. This data was being discarded
along with the already parsed moov/moof and playback would fail to continue
after the contents of this moov/moof are played.

This is particularly bad on fragmented files that have the mdat before the
corresponding moof. So you'd get:

mdat|moof|mdat|moof ...

When a moof was received, it usually came with some extra bytes that would
belong to the next mdat (because upstream doesn't care about atoms alignment).
So those bytes were being discarded and playback would fail.

This patch makes qtdemux store those extra bytes to reuse them later after the
mdat is emptied.

https://bugzilla.gnome.org/show_bug.cgi?id=710623
gst/isomp4/qtdemux.c
gst/isomp4/qtdemux.h