forked from len0rd/rockbox
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
This commit is contained in:
parent
008c368c87
commit
ce8640d7b8
2 changed files with 7 additions and 4 deletions
|
|
@ -771,12 +771,11 @@ int qtmovie_read(stream_t *file, demux_res_t *demux_res)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MAKEFOURCC('m','d','a','t'):
|
case MAKEFOURCC('m','d','a','t'):
|
||||||
read_chunk_mdat(&qtmovie, chunk_len);
|
|
||||||
/* Keep track of start of stream in file - used for seeking */
|
|
||||||
qtmovie.res->mdat_offset=stream_tell(qtmovie.stream);
|
|
||||||
/* There can be empty mdats before the real one. If so, skip them */
|
/* There can be empty mdats before the real one. If so, skip them */
|
||||||
if (qtmovie.res->mdat_len == 0)
|
if (chunk_len == 8)
|
||||||
break;
|
break;
|
||||||
|
read_chunk_mdat(&qtmovie, chunk_len);
|
||||||
|
qtmovie.res->mdat_offset=stream_tell(qtmovie.stream);
|
||||||
/* If we've already seen the format, assume there's nothing
|
/* If we've already seen the format, assume there's nothing
|
||||||
interesting after the mdat chunk (the file is "streamable").
|
interesting after the mdat chunk (the file is "streamable").
|
||||||
This avoids having to seek, which might cause rebuffering. */
|
This avoids having to seek, which might cause rebuffering. */
|
||||||
|
|
|
||||||
|
|
@ -681,6 +681,10 @@ static bool read_mp4_container(int fd, struct mp3entry* id3,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MP4_mdat:
|
case MP4_mdat:
|
||||||
|
/* Some AAC files appear to contain additional empty mdat chunks.
|
||||||
|
Ignore them. */
|
||||||
|
if(size == 0)
|
||||||
|
break;
|
||||||
id3->filesize = size;
|
id3->filesize = size;
|
||||||
if(id3->samples > 0) {
|
if(id3->samples > 0) {
|
||||||
/* We've already seen the moov chunk. */
|
/* We've already seen the moov chunk. */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue