summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2010-01-02 21:02:13 +0000
committerMichael Giacomelli <giac2000@hotmail.com>2010-01-02 21:02:13 +0000
commitce8640d7b8bf62c0b42823ff76c4387507353dae (patch)
tree1d53b22b0ae2d53b526196b4b8092f73a43e7095
parent008c368c87873615ccbe8bc0b3482d93ae15779d (diff)
downloadrockbox-ce8640d7b8bf62c0b42823ff76c4387507353dae.tar.gz
rockbox-ce8640d7b8bf62c0b42823ff76c4387507353dae.zip
Second part of FS#10832 by Juliusz Chroboczek. Ignore empty mdat chunks in mp4 files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24148 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/libm4a/demux.c7
-rw-r--r--apps/metadata/mp4.c4
2 files changed, 7 insertions, 4 deletions
diff --git a/apps/codecs/libm4a/demux.c b/apps/codecs/libm4a/demux.c
index 9f887b6b83..8c7189e158 100644
--- a/apps/codecs/libm4a/demux.c
+++ b/apps/codecs/libm4a/demux.c
@@ -771,12 +771,11 @@ int qtmovie_read(stream_t *file, demux_res_t *demux_res)
771 } 771 }
772 break; 772 break;
773 case MAKEFOURCC('m','d','a','t'): 773 case MAKEFOURCC('m','d','a','t'):
774 read_chunk_mdat(&qtmovie, chunk_len);
775 /* Keep track of start of stream in file - used for seeking */
776 qtmovie.res->mdat_offset=stream_tell(qtmovie.stream);
777 /* There can be empty mdats before the real one. If so, skip them */ 774 /* There can be empty mdats before the real one. If so, skip them */
778 if (qtmovie.res->mdat_len == 0) 775 if (chunk_len == 8)
779 break; 776 break;
777 read_chunk_mdat(&qtmovie, chunk_len);
778 qtmovie.res->mdat_offset=stream_tell(qtmovie.stream);
780 /* If we've already seen the format, assume there's nothing 779 /* If we've already seen the format, assume there's nothing
781 interesting after the mdat chunk (the file is "streamable"). 780 interesting after the mdat chunk (the file is "streamable").
782 This avoids having to seek, which might cause rebuffering. */ 781 This avoids having to seek, which might cause rebuffering. */
diff --git a/apps/metadata/mp4.c b/apps/metadata/mp4.c
index c5a525d9c5..cd6eda428f 100644
--- a/apps/metadata/mp4.c
+++ b/apps/metadata/mp4.c
@@ -681,6 +681,10 @@ static bool read_mp4_container(int fd, struct mp3entry* id3,
681 break; 681 break;
682 682
683 case MP4_mdat: 683 case MP4_mdat:
684 /* Some AAC files appear to contain additional empty mdat chunks.
685 Ignore them. */
686 if(size == 0)
687 break;
684 id3->filesize = size; 688 id3->filesize = size;
685 if(id3->samples > 0) { 689 if(id3->samples > 0) {
686 /* We've already seen the moov chunk. */ 690 /* We've already seen the moov chunk. */