summaryrefslogtreecommitdiff
path: root/apps/metadata/mp4.c
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2010-01-02 20:54:55 +0000
committerMichael Giacomelli <giac2000@hotmail.com>2010-01-02 20:54:55 +0000
commit008c368c87873615ccbe8bc0b3482d93ae15779d (patch)
treec93f268e7dba1603a76eaddb7f7002e9291fbb7a /apps/metadata/mp4.c
parent420b4e4be905c0e0930ec74201e680defb091234 (diff)
downloadrockbox-008c368c87873615ccbe8bc0b3482d93ae15779d.zip
rockbox-008c368c87873615ccbe8bc0b3482d93ae15779d.tar.gz
rockbox-008c368c87873615ccbe8bc0b3482d93ae15779d.tar.bz2
rockbox-008c368c87873615ccbe8bc0b3482d93ae15779d.tar.xz
Commit first part of FS#10832 by Juliusz Chroboczek. Allows playback of unstreamable AAC/ALAC files by stepping through the file to find the index, potientially rebuffering. This is likely to impose a battery life hit on files which are unstreamable and not much smaller then the buffer, but should not impact streamable files at all.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24147 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/metadata/mp4.c')
-rw-r--r--apps/metadata/mp4.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/metadata/mp4.c b/apps/metadata/mp4.c
index 44bc68e..c5a525d 100644
--- a/apps/metadata/mp4.c
+++ b/apps/metadata/mp4.c
@@ -548,6 +548,7 @@ static bool read_mp4_container(int fd, struct mp3entry* id3,
uint32_t type;
uint32_t handler = 0;
bool rc = true;
+ bool done = false;
do
{
@@ -681,6 +682,10 @@ static bool read_mp4_container(int fd, struct mp3entry* id3,
case MP4_mdat:
id3->filesize = size;
+ if(id3->samples > 0) {
+ /* We've already seen the moov chunk. */
+ done = true;
+ }
break;
case MP4_chpl:
@@ -708,15 +713,11 @@ static bool read_mp4_container(int fd, struct mp3entry* id3,
}
/* Skip final seek. */
- if (id3->filesize == 0)
+ if (!done)
{
lseek(fd, size, SEEK_CUR);
}
- }
- while (rc && (size_left > 0) && (errno == 0) && (id3->filesize == 0));
- /* Break on non-zero filesize, since Rockbox currently doesn't support
- * metadata after the mdat atom (which sets the filesize field).
- */
+ } while (rc && (size_left > 0) && (errno == 0) && !done);
return rc;
}