forked from len0rd/rockbox
Codecs: mp4: Fix seek in very large files
Samples count requires 64 bit Change-Id: Ia54be57d7d15b3db19dbc29ff8a06671594abb4b
This commit is contained in:
parent
d2f7777f7a
commit
27aa95afcb
4 changed files with 11 additions and 10 deletions
|
@ -137,13 +137,14 @@ int m4a_check_sample_offset(demux_res_t *demux_res, uint32_t frame, uint32_t *st
|
|||
/* Seek to desired sound sample location. Return 1 on success (and modify
|
||||
* sound_samples_done and current_sample), 0 if failed. */
|
||||
unsigned int m4a_seek(demux_res_t* demux_res, stream_t* stream,
|
||||
uint32_t sound_sample_loc, uint32_t* sound_samples_done,
|
||||
uint64_t sound_sample_loc, uint64_t* sound_samples_done,
|
||||
int* current_sample)
|
||||
{
|
||||
uint32_t i, sample_i, sound_sample_i;
|
||||
uint32_t i, sample_i;
|
||||
uint32_t time, time_cnt, time_dur;
|
||||
uint32_t chunk, chunk_first_sample;
|
||||
uint32_t offset;
|
||||
uint64_t sound_sample_i;
|
||||
time_to_sample_t *tts_tab = demux_res->time_to_sample;
|
||||
sample_offset_t *tco_tab = demux_res->lookup_table;
|
||||
uint32_t *tsz_tab = demux_res->sample_byte_sizes;
|
||||
|
@ -208,7 +209,7 @@ unsigned int m4a_seek(demux_res_t* demux_res, stream_t* stream,
|
|||
|
||||
DEBUGF("seek chunk=%lu, sample=%lu, soundsample=%lu, offset=%lu\n",
|
||||
(unsigned long)chunk, (unsigned long)chunk_first_sample,
|
||||
(unsigned long)sound_sample_i, (unsigned long)offset);
|
||||
sound_sample_i, (unsigned long)offset);
|
||||
|
||||
if (tsz_tab) {
|
||||
/* We have a sample-to-bytes table available so we can do accurate
|
||||
|
@ -260,13 +261,13 @@ unsigned int m4a_seek(demux_res_t* demux_res, stream_t* stream,
|
|||
* calculate the sound_samples_done value.
|
||||
*/
|
||||
unsigned int m4a_seek_raw(demux_res_t* demux_res, stream_t* stream,
|
||||
uint32_t file_loc, uint32_t* sound_samples_done,
|
||||
uint32_t file_loc, uint64_t* sound_samples_done,
|
||||
int* current_sample)
|
||||
{
|
||||
uint32_t i;
|
||||
uint32_t chunk_sample = 0;
|
||||
uint32_t total_samples = 0;
|
||||
uint32_t new_sound_sample = 0;
|
||||
uint64_t new_sound_sample = 0;
|
||||
uint32_t tmp_dur;
|
||||
uint32_t tmp_cnt;
|
||||
uint32_t new_pos;
|
||||
|
|
|
@ -130,10 +130,10 @@ int stream_eof(stream_t *stream);
|
|||
void stream_create(stream_t *stream,struct codec_api* ci);
|
||||
unsigned int get_sample_offset(demux_res_t *demux_res, uint32_t sample);
|
||||
unsigned int m4a_seek (demux_res_t* demux_res, stream_t* stream,
|
||||
uint32_t sound_sample_loc, uint32_t* sound_samples_done,
|
||||
uint64_t sound_sample_loc, uint64_t* sound_samples_done,
|
||||
int* current_sample);
|
||||
unsigned int m4a_seek_raw (demux_res_t* demux_res, stream_t* stream,
|
||||
uint32_t file_loc, uint32_t* sound_samples_done, int* current_sample);
|
||||
uint32_t file_loc, uint64_t* sound_samples_done, int* current_sample);
|
||||
int m4a_check_sample_offset(demux_res_t *demux_res, uint32_t frame, uint32_t *start);
|
||||
|
||||
#endif /* STREAM_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue