lcd-m6sp.c: remove \r
[kugel-rb.git] / apps / codecs / libm4a / demux.c
blobbde22384098ad448372b3bc98741c86179dab6c1
1 /*
2 * ALAC (Apple Lossless Audio Codec) decoder
3 * Copyright (c) 2005 David Hammerton
4 * All rights reserved.
6 * This is the quicktime container demuxer.
8 * http://crazney.net/programs/itunes/alac.html
9 *
10 * Permission is hereby granted, free of charge, to any person
11 * obtaining a copy of this software and associated documentation
12 * files (the "Software"), to deal in the Software without
13 * restriction, including without limitation the rights to use,
14 * copy, modify, merge, publish, distribute, sublicense, and/or
15 * sell copies of the Software, and to permit persons to whom the
16 * Software is furnished to do so, subject to the following conditions:
18 * The above copyright notice and this permission notice shall be
19 * included in all copies or substantial portions of the Software.
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28 * OTHER DEALINGS IN THE SOFTWARE.
32 #include <string.h>
33 #include <inttypes.h>
34 #include <stdlib.h>
36 #include "codeclib.h"
38 #include "m4a.h"
40 #undef DEBUGF
41 #if defined(DEBUG)
42 #define DEBUGF qtmovie->stream->ci->debugf
43 #else
44 #define DEBUGF(...)
45 #endif
47 typedef struct
49 stream_t *stream;
50 demux_res_t *res;
51 } qtmovie_t;
54 /* chunk handlers */
55 static void read_chunk_ftyp(qtmovie_t *qtmovie, size_t chunk_len)
57 fourcc_t type;
58 uint32_t minor_ver;
59 size_t size_remaining = chunk_len - 8;
61 type = stream_read_uint32(qtmovie->stream);
62 size_remaining-=4;
63 if ((type != MAKEFOURCC('M','4','A',' ')) &&
64 (type != MAKEFOURCC('M','4','B',' ')) &&
65 (type != MAKEFOURCC('m','p','4','2')) &&
66 (type != MAKEFOURCC('3','g','p','6')) &&
67 (type != MAKEFOURCC('q','t',' ',' ')) &&
68 (type != MAKEFOURCC('i','s','o','m')))
70 DEBUGF("not M4A file\n");
71 return;
73 minor_ver = stream_read_uint32(qtmovie->stream);
74 size_remaining-=4;
76 /* compatible brands */
77 while (size_remaining)
79 /* unused */
80 /*fourcc_t cbrand =*/ stream_read_uint32(qtmovie->stream);
81 size_remaining-=4;
85 static uint32_t mp4ff_read_mp4_descr_length(stream_t* stream)
87 uint8_t b;
88 uint8_t numBytes = 0;
89 uint32_t length = 0;
93 b = stream_read_uint8(stream);
94 numBytes++;
95 length = (length << 7) | (b & 0x7F);
96 } while ((b & 0x80) && numBytes < 4);
98 return length;
101 /* The following function is based on mp4ff */
102 static bool read_chunk_esds(qtmovie_t *qtmovie, size_t chunk_len)
104 uint8_t tag;
105 uint32_t temp;
106 int audioType;
107 int32_t maxBitrate;
108 int32_t avgBitrate;
110 (void)chunk_len;
111 /* version and flags */
112 temp=stream_read_uint32(qtmovie->stream);
114 /* get and verify ES_DescrTag */
115 tag = stream_read_uint8(qtmovie->stream);
116 if (tag == 0x03)
118 /* read length */
119 if (mp4ff_read_mp4_descr_length(qtmovie->stream) < 5 + 15)
121 return false;
123 /* skip 3 bytes */
124 stream_skip(qtmovie->stream,3);
125 } else {
126 /* skip 2 bytes */
127 stream_skip(qtmovie->stream,2);
130 /* get and verify DecoderConfigDescrTab */
131 if (stream_read_uint8(qtmovie->stream) != 0x04)
133 return false;
136 /* read length */
137 temp = mp4ff_read_mp4_descr_length(qtmovie->stream);
138 if (temp < 13) return false;
140 audioType = stream_read_uint8(qtmovie->stream);
141 temp=stream_read_int32(qtmovie->stream);//0x15000414 ????
142 maxBitrate = stream_read_int32(qtmovie->stream);
143 avgBitrate = stream_read_int32(qtmovie->stream);
144 DEBUGF("audioType=%d, maxBitrate=%ld, avgBitrate=%ld\n",audioType,
145 (long)maxBitrate,(long)avgBitrate);
147 /* get and verify DecSpecificInfoTag */
148 if (stream_read_uint8(qtmovie->stream) != 0x05)
150 return false;
153 /* read length */
154 qtmovie->res->codecdata_len = mp4ff_read_mp4_descr_length(qtmovie->stream);
155 if (qtmovie->res->codecdata_len > MAX_CODECDATA_SIZE)
157 DEBUGF("codecdata too large (%d) in esds\n",
158 (int)qtmovie->res->codecdata_len);
159 return false;
162 stream_read(qtmovie->stream, qtmovie->res->codecdata_len, qtmovie->res->codecdata);
164 /* will skip the remainder of the atom */
165 return true;
168 static bool read_chunk_stsd(qtmovie_t *qtmovie, size_t chunk_len)
170 unsigned int i;
171 int j;
172 uint32_t numentries;
173 size_t size_remaining = chunk_len - 8;
175 /* version */
176 stream_read_uint8(qtmovie->stream);
177 size_remaining -= 1;
178 /* flags */
179 stream_read_uint8(qtmovie->stream);
180 stream_read_uint8(qtmovie->stream);
181 stream_read_uint8(qtmovie->stream);
182 size_remaining -= 3;
184 numentries = stream_read_uint32(qtmovie->stream);
185 size_remaining -= 4;
187 if (numentries != 1)
189 DEBUGF("only expecting one entry in sample description atom!\n");
190 return false;
193 for (i = 0; i < numentries; i++)
195 uint32_t entry_size;
197 uint32_t entry_remaining;
199 entry_size = stream_read_uint32(qtmovie->stream);
200 qtmovie->res->format = stream_read_uint32(qtmovie->stream);
201 DEBUGF("format: %c%c%c%c\n",SPLITFOURCC(qtmovie->res->format));
202 entry_remaining = entry_size;
203 entry_remaining -= 8;
205 /* sound info: */
207 /* reserved + data reference index + sound version + reserved */
208 stream_skip(qtmovie->stream, 6 + 2 + 2 + 6);
209 entry_remaining -= 6 + 2 + 2 + 6;
211 qtmovie->res->num_channels = stream_read_uint16(qtmovie->stream);
212 qtmovie->res->sound_sample_size = stream_read_uint16(qtmovie->stream);
213 entry_remaining -= 4;
215 /* packet size */
216 stream_skip(qtmovie->stream, 2);
217 qtmovie->res->sound_sample_rate = stream_read_uint32(qtmovie->stream);
218 /* reserved size */
219 stream_skip(qtmovie->stream, 2);
220 entry_remaining -= 8;
222 /* remaining is codec data */
224 if ((qtmovie->res->format==MAKEFOURCC('a','l','a','c'))) {
225 if (qtmovie->stream->ci->id3->codectype!=AFMT_MP4_ALAC) {
226 return false;
229 /* 12 = audio format atom, 8 = padding */
230 qtmovie->res->codecdata_len = entry_remaining + 12 + 8;
231 if (qtmovie->res->codecdata_len > MAX_CODECDATA_SIZE)
233 DEBUGF("codecdata too large (%d) in stsd\n",
234 (int)qtmovie->res->codecdata_len);
235 return false;
238 memset(qtmovie->res->codecdata, 0, qtmovie->res->codecdata_len);
239 /* audio format atom */
240 #if 0
241 /* The ALAC decoder skips these bytes, so there is no need to store them,
242 and this code isn't endian/alignment safe */
243 ((unsigned int*)qtmovie->res->codecdata)[0] = 0x0c000000;
244 ((unsigned int*)qtmovie->res->codecdata)[1] = MAKEFOURCC('a','m','r','f');
245 ((unsigned int*)qtmovie->res->codecdata)[2] = MAKEFOURCC('c','a','l','a');
246 #endif
248 stream_read(qtmovie->stream,
249 entry_remaining,
250 ((char*)qtmovie->res->codecdata) + 12);
251 entry_remaining -= entry_remaining;
253 if (entry_remaining)
254 stream_skip(qtmovie->stream, entry_remaining);
256 } else if (qtmovie->res->format==MAKEFOURCC('m','p','4','a')) {
257 if (qtmovie->stream->ci->id3->codectype!=AFMT_MP4_AAC) {
258 return false;
261 size_t sub_chunk_len;
262 fourcc_t sub_chunk_id;
264 sub_chunk_len = stream_read_uint32(qtmovie->stream);
265 if (sub_chunk_len <= 1 || sub_chunk_len > entry_remaining)
267 DEBUGF("strange size (%lu) for chunk inside mp4a\n",
268 (unsigned long)sub_chunk_len);
269 return false;
272 sub_chunk_id = stream_read_uint32(qtmovie->stream);
274 if (sub_chunk_id != MAKEFOURCC('e','s','d','s'))
276 DEBUGF("Expected esds chunk inside mp4a, found %c%c%c%c\n",SPLITFOURCC(sub_chunk_id));
277 return false;
280 j=qtmovie->stream->ci->curpos+sub_chunk_len-8;
281 if (read_chunk_esds(qtmovie,sub_chunk_len)) {
282 if (j!=qtmovie->stream->ci->curpos) {
283 DEBUGF("curpos=%ld, j=%d - Skipping %ld bytes\n",qtmovie->stream->ci->curpos,j,j-qtmovie->stream->ci->curpos);
284 stream_skip(qtmovie->stream,j-qtmovie->stream->ci->curpos);
286 entry_remaining-=sub_chunk_len;
287 } else {
288 DEBUGF("Error reading esds\n");
289 return false;
292 DEBUGF("entry_remaining=%ld\n",(long)entry_remaining);
293 stream_skip(qtmovie->stream,entry_remaining);
295 } else {
296 DEBUGF("expecting 'alac' or 'mp4a' data format, got %c%c%c%c\n",
297 SPLITFOURCC(qtmovie->res->format));
298 return false;
301 return true;
304 static bool read_chunk_stts(qtmovie_t *qtmovie, size_t chunk_len)
306 unsigned int i;
307 uint32_t numentries;
308 size_t size_remaining = chunk_len - 8;
310 /* version */
311 stream_read_uint8(qtmovie->stream);
312 size_remaining -= 1;
313 /* flags */
314 stream_read_uint8(qtmovie->stream);
315 stream_read_uint8(qtmovie->stream);
316 stream_read_uint8(qtmovie->stream);
317 size_remaining -= 3;
319 numentries = stream_read_uint32(qtmovie->stream);
320 size_remaining -= 4;
322 qtmovie->res->num_time_to_samples = numentries;
323 qtmovie->res->time_to_sample = malloc(numentries * sizeof(*qtmovie->res->time_to_sample));
325 if (!qtmovie->res->time_to_sample)
327 DEBUGF("stts too large\n");
328 return false;
331 for (i = 0; i < numentries; i++)
333 qtmovie->res->time_to_sample[i].sample_count = stream_read_uint32(qtmovie->stream);
334 qtmovie->res->time_to_sample[i].sample_duration = stream_read_uint32(qtmovie->stream);
335 size_remaining -= 8;
338 if (size_remaining)
340 DEBUGF("ehm, size remianing?\n");
341 stream_skip(qtmovie->stream, size_remaining);
344 return true;
347 static bool read_chunk_stsz(qtmovie_t *qtmovie, size_t chunk_len)
349 unsigned int i;
350 uint32_t numentries;
351 size_t size_remaining = chunk_len - 8;
353 /* version */
354 stream_read_uint8(qtmovie->stream);
355 size_remaining -= 1;
356 /* flags */
357 stream_read_uint8(qtmovie->stream);
358 stream_read_uint8(qtmovie->stream);
359 stream_read_uint8(qtmovie->stream);
360 size_remaining -= 3;
362 /* default sample size */
363 if (stream_read_uint32(qtmovie->stream) != 0)
365 DEBUGF("i was expecting variable samples sizes\n");
366 stream_read_uint32(qtmovie->stream);
367 size_remaining -= 4;
368 return true;
370 size_remaining -= 4;
372 numentries = stream_read_uint32(qtmovie->stream);
373 size_remaining -= 4;
375 qtmovie->res->num_sample_byte_sizes = numentries;
376 qtmovie->res->sample_byte_size = malloc(numentries * sizeof(*qtmovie->res->sample_byte_size));
378 if (!qtmovie->res->sample_byte_size)
380 DEBUGF("stsz too large\n");
381 return false;
384 for (i = 0; i < numentries; i++)
386 uint32_t v = stream_read_uint32(qtmovie->stream);
388 if (v > 0x0000ffff)
390 DEBUGF("stsz[%d] > 65 kB (%ld)\n", i, (long)v);
391 return false;
394 qtmovie->res->sample_byte_size[i] = v;
395 size_remaining -= 4;
398 if (size_remaining)
400 DEBUGF("ehm, size remianing?\n");
401 stream_skip(qtmovie->stream, size_remaining);
404 return true;
407 static bool read_chunk_stsc(qtmovie_t *qtmovie, size_t chunk_len)
409 unsigned int i;
410 uint32_t numentries;
411 size_t size_remaining = chunk_len - 8;
413 /* version + flags */
414 stream_read_uint32(qtmovie->stream);
415 size_remaining -= 4;
417 numentries = stream_read_uint32(qtmovie->stream);
418 size_remaining -= 4;
420 qtmovie->res->num_sample_to_chunks = numentries;
421 qtmovie->res->sample_to_chunk = malloc(numentries *
422 sizeof(*qtmovie->res->sample_to_chunk));
424 if (!qtmovie->res->sample_to_chunk)
426 DEBUGF("stsc too large\n");
427 return false;
430 for (i = 0; i < numentries; i++)
432 qtmovie->res->sample_to_chunk[i].first_chunk =
433 stream_read_uint32(qtmovie->stream);
434 qtmovie->res->sample_to_chunk[i].num_samples =
435 stream_read_uint32(qtmovie->stream);
436 stream_read_uint32(qtmovie->stream);
437 size_remaining -= 12;
440 if (size_remaining)
442 DEBUGF("ehm, size remianing?\n");
443 stream_skip(qtmovie->stream, size_remaining);
446 return true;
449 static bool read_chunk_stco(qtmovie_t *qtmovie, size_t chunk_len)
451 unsigned int i;
452 uint32_t numentries;
453 size_t size_remaining = chunk_len - 8;
455 /* version + flags */
456 stream_read_uint32(qtmovie->stream);
457 size_remaining -= 4;
459 numentries = stream_read_uint32(qtmovie->stream);
460 size_remaining -= 4;
462 qtmovie->res->num_chunk_offsets = numentries;
463 qtmovie->res->chunk_offset = malloc(numentries *
464 sizeof(*qtmovie->res->chunk_offset));
466 if (!qtmovie->res->chunk_offset)
468 DEBUGF("stco too large\n");
469 return false;
472 for (i = 0; i < numentries; i++)
474 qtmovie->res->chunk_offset[i] = stream_read_uint32(qtmovie->stream);
475 size_remaining -= 4;
478 if (size_remaining)
480 DEBUGF("ehm, size remianing?\n");
481 stream_skip(qtmovie->stream, size_remaining);
484 return true;
487 static bool read_chunk_stbl(qtmovie_t *qtmovie, size_t chunk_len)
489 size_t size_remaining = chunk_len - 8;
491 while (size_remaining)
493 size_t sub_chunk_len;
494 fourcc_t sub_chunk_id;
496 sub_chunk_len = stream_read_uint32(qtmovie->stream);
497 if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining)
499 DEBUGF("strange size (%lu) for chunk inside stbl\n",
500 (unsigned long)sub_chunk_len);
501 return false;
504 sub_chunk_id = stream_read_uint32(qtmovie->stream);
506 switch (sub_chunk_id)
508 case MAKEFOURCC('s','t','s','d'):
509 if (!read_chunk_stsd(qtmovie, sub_chunk_len)) {
510 return false;
512 break;
513 case MAKEFOURCC('s','t','t','s'):
514 if (!read_chunk_stts(qtmovie, sub_chunk_len))
516 return false;
518 break;
519 case MAKEFOURCC('s','t','s','z'):
520 if (!read_chunk_stsz(qtmovie, sub_chunk_len))
522 return false;
524 break;
525 case MAKEFOURCC('s','t','s','c'):
526 if (!read_chunk_stsc(qtmovie, sub_chunk_len))
528 return false;
530 break;
531 case MAKEFOURCC('s','t','c','o'):
532 if (!read_chunk_stco(qtmovie, sub_chunk_len))
534 return false;
536 break;
537 default:
538 /*DEBUGF("(stbl) unknown chunk id: %c%c%c%c\n",
539 SPLITFOURCC(sub_chunk_id));*/
540 stream_skip(qtmovie->stream, sub_chunk_len - 8);
543 size_remaining -= sub_chunk_len;
545 return true;
548 static bool read_chunk_minf(qtmovie_t *qtmovie, size_t chunk_len)
550 size_t size_remaining = chunk_len - 8;
551 uint32_t i;
553 /* Check for smhd, only kind of minf we care about */
555 if ((i = stream_read_uint32(qtmovie->stream)) != 16)
557 DEBUGF("unexpected size in media info: %ld\n", (long)i);
558 stream_skip(qtmovie->stream, size_remaining-4);
559 return true;
562 if (stream_read_uint32(qtmovie->stream) != MAKEFOURCC('s','m','h','d'))
564 DEBUGF("not a sound header! can't handle this.\n");
565 return false;
568 /* now skip the rest of the atom */
569 stream_skip(qtmovie->stream, 16 - 8);
570 size_remaining -= 16;
572 while (size_remaining)
574 size_t sub_chunk_len;
575 fourcc_t sub_chunk_id;
577 sub_chunk_len = stream_read_uint32(qtmovie->stream);
579 if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining)
581 DEBUGF("strange size (%lu) for chunk inside minf\n",
582 (unsigned long)sub_chunk_len);
583 return false;
586 sub_chunk_id = stream_read_uint32(qtmovie->stream);
588 switch (sub_chunk_id)
590 case MAKEFOURCC('s','t','b','l'):
591 if (!read_chunk_stbl(qtmovie, sub_chunk_len)) {
592 return false;
594 break;
595 default:
596 /*DEBUGF("(minf) unknown chunk id: %c%c%c%c\n",
597 SPLITFOURCC(sub_chunk_id));*/
598 stream_skip(qtmovie->stream, sub_chunk_len - 8);
599 break;
602 size_remaining -= sub_chunk_len;
604 return true;
607 static bool read_chunk_mdia(qtmovie_t *qtmovie, size_t chunk_len)
609 size_t size_remaining = chunk_len - 8;
611 while (size_remaining)
613 size_t sub_chunk_len;
614 fourcc_t sub_chunk_id;
616 sub_chunk_len = stream_read_uint32(qtmovie->stream);
617 if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining)
619 DEBUGF("strange size (%lu) for chunk inside mdia\n",
620 (unsigned long)sub_chunk_len);
621 return false;
624 sub_chunk_id = stream_read_uint32(qtmovie->stream);
626 switch (sub_chunk_id)
628 case MAKEFOURCC('m','i','n','f'):
629 if (!read_chunk_minf(qtmovie, sub_chunk_len)) {
630 return false;
632 break;
633 default:
634 /*DEBUGF("(mdia) unknown chunk id: %c%c%c%c\n",
635 SPLITFOURCC(sub_chunk_id));*/
636 stream_skip(qtmovie->stream, sub_chunk_len - 8);
637 break;
640 size_remaining -= sub_chunk_len;
642 return true;
645 /* 'trak' - a movie track - contains other atoms */
646 static bool read_chunk_trak(qtmovie_t *qtmovie, size_t chunk_len)
648 size_t size_remaining = chunk_len - 8;
650 while (size_remaining)
652 size_t sub_chunk_len;
653 fourcc_t sub_chunk_id;
655 sub_chunk_len = stream_read_uint32(qtmovie->stream);
656 if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining)
658 DEBUGF("strange size (%lu) for chunk inside trak\n",
659 (unsigned long)sub_chunk_len);
660 return false;
663 sub_chunk_id = stream_read_uint32(qtmovie->stream);
665 switch (sub_chunk_id)
667 case MAKEFOURCC('m','d','i','a'):
668 if (!read_chunk_mdia(qtmovie, sub_chunk_len)) {
669 return false;
671 break;
672 default:
673 /*DEBUGF("(trak) unknown chunk id: %c%c%c%c\n",
674 SPLITFOURCC(sub_chunk_id));*/
675 stream_skip(qtmovie->stream, sub_chunk_len - 8);
676 break;
679 size_remaining -= sub_chunk_len;
681 return true;
684 /* 'moov' movie atom - contains other atoms */
685 static bool read_chunk_moov(qtmovie_t *qtmovie, size_t chunk_len)
687 size_t size_remaining = chunk_len - 8;
689 while (size_remaining)
691 size_t sub_chunk_len;
692 fourcc_t sub_chunk_id;
694 sub_chunk_len = stream_read_uint32(qtmovie->stream);
695 if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining)
697 DEBUGF("strange size (%lu) for chunk inside moov\n",
698 (unsigned long)sub_chunk_len);
699 return false;
702 sub_chunk_id = stream_read_uint32(qtmovie->stream);
704 switch (sub_chunk_id)
706 case MAKEFOURCC('t','r','a','k'):
707 if (!read_chunk_trak(qtmovie, sub_chunk_len)) {
708 return false;
710 break;
711 default:
712 /*DEBUGF("(moov) unknown chunk id: %c%c%c%c\n",
713 SPLITFOURCC(sub_chunk_id));*/
714 stream_skip(qtmovie->stream, sub_chunk_len - 8);
715 break;
718 size_remaining -= sub_chunk_len;
720 return true;
723 static void read_chunk_mdat(qtmovie_t *qtmovie, size_t chunk_len)
725 size_t size_remaining = chunk_len - 8;
727 qtmovie->res->mdat_len = size_remaining;
730 int qtmovie_read(stream_t *file, demux_res_t *demux_res)
732 qtmovie_t qtmovie;
734 /* construct the stream */
735 qtmovie.stream = file;
736 qtmovie.res = demux_res;
738 /* read the chunks */
739 while (1)
741 size_t chunk_len;
742 fourcc_t chunk_id;
744 chunk_len = stream_read_uint32(qtmovie.stream);
745 if (stream_eof(qtmovie.stream))
747 if(qtmovie.res->mdat_offset == 0 || qtmovie.res->format == 0)
748 return 0;
749 stream_seek(qtmovie.stream, qtmovie.res->mdat_offset);
750 return 1;
753 if (chunk_len == 1)
755 //DEBUGF("need 64bit support\n");
756 return 0;
758 chunk_id = stream_read_uint32(qtmovie.stream);
760 //DEBUGF("Found a chunk %c%c%c%c, length=%d\n",SPLITFOURCC(chunk_id),chunk_len);
761 switch (chunk_id)
763 case MAKEFOURCC('f','t','y','p'):
764 read_chunk_ftyp(&qtmovie, chunk_len);
765 break;
766 case MAKEFOURCC('m','o','o','v'):
767 if (!read_chunk_moov(&qtmovie, chunk_len)) {
768 return 0;
770 break;
771 case MAKEFOURCC('m','d','a','t'):
772 /* There can be empty mdats before the real one. If so, skip them */
773 if (chunk_len == 8)
774 break;
775 read_chunk_mdat(&qtmovie, chunk_len);
776 qtmovie.res->mdat_offset=stream_tell(qtmovie.stream);
777 /* If we've already seen the format, assume there's nothing
778 interesting after the mdat chunk (the file is "streamable").
779 This avoids having to seek, which might cause rebuffering. */
780 if(qtmovie.res->format > 0)
781 return 1;
782 stream_skip(qtmovie.stream, chunk_len - 8);
783 break;
785 /* these following atoms can be skipped !!!! */
786 case MAKEFOURCC('f','r','e','e'):
787 stream_skip(qtmovie.stream, chunk_len - 8);
788 break;
789 default:
790 //DEBUGF("(top) unknown chunk id: %c%c%c%c\n",SPLITFOURCC(chunk_id));
791 return 0;
795 return 0;