diff options
author | Magnus Holmgren <magnushol@gmail.com> | 2007-01-30 21:42:36 +0000 |
---|---|---|
committer | Magnus Holmgren <magnushol@gmail.com> | 2007-01-30 21:42:36 +0000 |
commit | fc1efc7b13674a6d3a6b21f634a1038197775a75 (patch) | |
tree | 03effc96443c89d27cb54965079e55c6ced323de /apps/codecs/libm4a/m4a.c | |
parent | ca3b5bb8e404ff260414c46e89e2e2c7c6b3c5fd (diff) | |
download | rockbox-fc1efc7b13674a6d3a6b21f634a1038197775a75.tar.gz rockbox-fc1efc7b13674a6d3a6b21f634a1038197775a75.zip |
Fix a couple of MP4 demuxing problems, preventing playback in a few cases. All my test files now play properly.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12161 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libm4a/m4a.c')
-rw-r--r-- | apps/codecs/libm4a/m4a.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/codecs/libm4a/m4a.c b/apps/codecs/libm4a/m4a.c index 0a87ec35ea..f5aaeca302 100644 --- a/apps/codecs/libm4a/m4a.c +++ b/apps/codecs/libm4a/m4a.c | |||
@@ -199,7 +199,7 @@ unsigned int get_sample_offset(demux_res_t *demux_res, uint32_t sample) | |||
199 | prev_chunk_samples = demux_res->sample_to_chunk[i].num_samples; | 199 | prev_chunk_samples = demux_res->sample_to_chunk[i].num_samples; |
200 | } | 200 | } |
201 | 201 | ||
202 | if (demux_res->num_sample_to_chunks > 1) | 202 | if (sample >= demux_res->sample_to_chunk[0].num_samples) |
203 | { | 203 | { |
204 | chunk = prev_chunk + (sample - total_samples) / prev_chunk_samples; | 204 | chunk = prev_chunk + (sample - total_samples) / prev_chunk_samples; |
205 | } | 205 | } |
@@ -223,7 +223,8 @@ unsigned int get_sample_offset(demux_res_t *demux_res, uint32_t sample) | |||
223 | file_offset = demux_res->chunk_offset[chunk - 1]; | 223 | file_offset = demux_res->chunk_offset[chunk - 1]; |
224 | } | 224 | } |
225 | 225 | ||
226 | if (chunk_sample > sample) { | 226 | if (chunk_sample > sample) |
227 | { | ||
227 | return 0; | 228 | return 0; |
228 | } | 229 | } |
229 | 230 | ||