From d93626d8fc6996d79627e18626ff5dece7dab9bf Mon Sep 17 00:00:00 2001 From: Mike Melanson Date: Wed, 1 Jan 2003 19:47:43 +0000 Subject: added hack to support free atom masquerading as a moov atom CVS patchset: 3745 CVS date: 2003/01/01 19:47:43 --- src/demuxers/demux_qt.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src') 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) && -- cgit v1.2.3