summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2003-01-01 19:47:43 +0000
committerMike Melanson <mike@multimedia.cx>2003-01-01 19:47:43 +0000
commitd93626d8fc6996d79627e18626ff5dece7dab9bf (patch)
tree92d8725653b65fa6878378527fffe3eeb2c165d5 /src
parente9a665eae94e4384e59705044d5e2d1cefa11f48 (diff)
downloadxine-lib-d93626d8fc6996d79627e18626ff5dece7dab9bf.tar.gz
xine-lib-d93626d8fc6996d79627e18626ff5dece7dab9bf.tar.bz2
added hack to support free atom masquerading as a moov atom
CVS patchset: 3745 CVS date: 2003/01/01 19:47:43
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_qt.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c
index 4e741ea6a..72a7553b2 100644
--- a/src/demuxers/demux_qt.c
+++ b/src/demuxers/demux_qt.c
@@ -30,7 +30,7 @@
* build_frame_table
* free_qt_info
*
- * $Id: demux_qt.c,v 1.136 2002/12/22 16:09:30 esnel Exp $
+ * $Id: demux_qt.c,v 1.137 2003/01/01 19:47:43 tmmm Exp $
*
*/
@@ -480,6 +480,28 @@ static void find_moov_atom(input_plugin_t *input, off_t *moov_offset,
break;
}
+ /* special case alert: 'free' atoms are known to contain 'cmov' atoms.
+ * If this is a free atom, check for cmov immediately following.
+ * QT Player can handle it, so xine should too. */
+ if (atom == FREE_ATOM) {
+
+ /* get the next atom preamble */
+ if (input->read(input, atom_preamble, ATOM_PREAMBLE_SIZE) !=
+ ATOM_PREAMBLE_SIZE)
+ break;
+
+ /* if there is a cmov, qualify this free atom as the moov atom */
+ if (BE_32(&atom_preamble[4]) == CMOV_ATOM) {
+ /* pos = current pos minus 2 atom preambles */
+ *moov_offset = input->get_current_pos(input) - ATOM_PREAMBLE_SIZE * 2;
+ *moov_size = atom_size;
+ break;
+ } else {
+ /* otherwise, rewind the stream */
+ input->seek(input, -ATOM_PREAMBLE_SIZE, SEEK_CUR);
+ }
+ }
+
/* if this atom is not the moov atom, make sure that it is at least one
* of the other top-level QT atom */
if ((atom != FREE_ATOM) &&