forked from len0rd/rockbox
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
This commit is contained in:
parent
ca3b5bb8e4
commit
fc1efc7b13
3 changed files with 14 additions and 3 deletions
|
|
@ -199,7 +199,7 @@ unsigned int get_sample_offset(demux_res_t *demux_res, uint32_t sample)
|
|||
prev_chunk_samples = demux_res->sample_to_chunk[i].num_samples;
|
||||
}
|
||||
|
||||
if (demux_res->num_sample_to_chunks > 1)
|
||||
if (sample >= demux_res->sample_to_chunk[0].num_samples)
|
||||
{
|
||||
chunk = prev_chunk + (sample - total_samples) / prev_chunk_samples;
|
||||
}
|
||||
|
|
@ -223,7 +223,8 @@ unsigned int get_sample_offset(demux_res_t *demux_res, uint32_t sample)
|
|||
file_offset = demux_res->chunk_offset[chunk - 1];
|
||||
}
|
||||
|
||||
if (chunk_sample > sample) {
|
||||
if (chunk_sample > sample)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue