summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/libm4a/m4a.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/codecs/libm4a/m4a.c')
-rw-r--r--lib/rbcodec/codecs/libm4a/m4a.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/rbcodec/codecs/libm4a/m4a.c b/lib/rbcodec/codecs/libm4a/m4a.c
index 958d0b1575..6adc58dab0 100644
--- a/lib/rbcodec/codecs/libm4a/m4a.c
+++ b/lib/rbcodec/codecs/libm4a/m4a.c
@@ -141,7 +141,7 @@ int m4a_check_sample_offset(demux_res_t *demux_res, uint32_t frame, uint32_t *st
141 * sound_samples_done and current_sample), 0 if failed. */ 141 * sound_samples_done and current_sample), 0 if failed. */
142unsigned int m4a_seek(demux_res_t* demux_res, stream_t* stream, 142unsigned int m4a_seek(demux_res_t* demux_res, stream_t* stream,
143 uint64_t sound_sample_loc, uint64_t* sound_samples_done, 143 uint64_t sound_sample_loc, uint64_t* sound_samples_done,
144 int* current_sample) 144 int* current_sample, int* lookup_table_idx)
145{ 145{
146 uint32_t i, sample_i; 146 uint32_t i, sample_i;
147 uint32_t time, time_cnt, time_dur; 147 uint32_t time, time_cnt, time_dur;
@@ -189,6 +189,7 @@ unsigned int m4a_seek(demux_res_t* demux_res, stream_t* stream,
189 189
190 /* The preceding chunk is the one that contains 'sample_i'. */ 190 /* The preceding chunk is the one that contains 'sample_i'. */
191 chunk--; 191 chunk--;
192 *lookup_table_idx = chunk;
192 chunk_first_sample = tco_tab[chunk].sample; 193 chunk_first_sample = tco_tab[chunk].sample;
193 offset = tco_tab[chunk].offset; 194 offset = tco_tab[chunk].offset;
194 195
@@ -265,7 +266,7 @@ unsigned int m4a_seek(demux_res_t* demux_res, stream_t* stream,
265 */ 266 */
266unsigned int m4a_seek_raw(demux_res_t* demux_res, stream_t* stream, 267unsigned int m4a_seek_raw(demux_res_t* demux_res, stream_t* stream,
267 uint32_t file_loc, uint64_t* sound_samples_done, 268 uint32_t file_loc, uint64_t* sound_samples_done,
268 int* current_sample) 269 int* current_sample, int* lookup_table_idx)
269{ 270{
270 uint32_t i; 271 uint32_t i;
271 uint32_t chunk_sample = 0; 272 uint32_t chunk_sample = 0;
@@ -283,6 +284,7 @@ unsigned int m4a_seek_raw(demux_res_t* demux_res, stream_t* stream,
283 break; 284 break;
284 } 285 }
285 i = (i>0) ? i-1 : 0; /* We want the last chunk _before_ file_loc. */ 286 i = (i>0) ? i-1 : 0; /* We want the last chunk _before_ file_loc. */
287 *lookup_table_idx = i;
286 chunk_sample = demux_res->lookup_table[i].sample; 288 chunk_sample = demux_res->lookup_table[i].sample;
287 new_pos = demux_res->lookup_table[i].offset; 289 new_pos = demux_res->lookup_table[i].offset;
288 290