From 7183ad34fbd7037a34e93fb451a980790616bc17 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Fri, 19 Jul 2002 03:21:49 +0000 Subject: do not assume media type atoms will occur before the other atoms. for several .mp4 files they won't. CVS patchset: 2315 CVS date: 2002/07/19 03:21:49 --- src/demuxers/demux_qt.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index ba6aaba4a..6088ee0ab 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.70 2002/07/17 20:29:03 miguelfreitas Exp $ + * $Id: demux_qt.c,v 1.71 2002/07/19 03:21:49 miguelfreitas Exp $ * */ @@ -407,15 +407,24 @@ static qt_error parse_trak_atom(qt_sample_table *sample_table, /* default type */ sample_table->type = MEDIA_OTHER; - /* search for the useful atoms */ + /* search for media type atoms */ for (i = ATOM_PREAMBLE_SIZE; i < trak_atom_size - 4; i++) { current_atom = BE_32(&trak_atom[i]); - if (current_atom == VMHD_ATOM) + if (current_atom == VMHD_ATOM) { sample_table->type = MEDIA_VIDEO; - else if (current_atom == SMHD_ATOM) + break; + } else if (current_atom == SMHD_ATOM) { sample_table->type = MEDIA_AUDIO; - else if (current_atom == TKHD_ATOM) + break; + } + } + + /* search for the useful atoms */ + for (i = ATOM_PREAMBLE_SIZE; i < trak_atom_size - 4; i++) { + current_atom = BE_32(&trak_atom[i]); + + if (current_atom == TKHD_ATOM) sample_table->flags = BE_16(&trak_atom[i + 6]); else if (current_atom == ELST_ATOM) { -- cgit v1.2.3