summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/libm4a
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2023-09-19 11:47:38 -0400
committerSolomon Peachy <pizza@shaftnet.org>2023-09-19 11:47:38 -0400
commitac82a653bbcd13d95aeb8f5934cc486c7f703152 (patch)
tree264922a0c16e97af179048ecdb4bc9cc2c9be3f1 /lib/rbcodec/codecs/libm4a
parent001a338e5126cbec422867481ef7485b1b3c8eea (diff)
downloadrockbox-ac82a653bbcd13d95aeb8f5934cc486c7f703152.tar.gz
rockbox-ac82a653bbcd13d95aeb8f5934cc486c7f703152.zip
libm4a: Fix warnings introduced in 001a338e51
Change-Id: Ia915e6f8babbd71533f22af566e5c45c2b40fbe5
Diffstat (limited to 'lib/rbcodec/codecs/libm4a')
-rw-r--r--lib/rbcodec/codecs/libm4a/m4a.c26
-rw-r--r--lib/rbcodec/codecs/libm4a/m4a.h14
2 files changed, 20 insertions, 20 deletions
diff --git a/lib/rbcodec/codecs/libm4a/m4a.c b/lib/rbcodec/codecs/libm4a/m4a.c
index 6adc58dab0..295c39c5ff 100644
--- a/lib/rbcodec/codecs/libm4a/m4a.c
+++ b/lib/rbcodec/codecs/libm4a/m4a.c
@@ -114,10 +114,10 @@ void stream_create(stream_t *stream,struct codec_api* ci)
114 114
115/* Check if there is a dedicated byte position contained for the given frame. 115/* Check if there is a dedicated byte position contained for the given frame.
116 * Return this byte position in case of success or return -1. This allows to 116 * Return this byte position in case of success or return -1. This allows to
117 * skip empty samples. 117 * skip empty samples.
118 * During standard playback the search result (index i) will always increase. 118 * During standard playback the search result (index i) will always increase.
119 * Therefor we save this index and let the caller set this value again as start 119 * Therefor we save this index and let the caller set this value again as start
120 * index when calling m4a_check_sample_offset() for the next frame. This 120 * index when calling m4a_check_sample_offset() for the next frame. This
121 * reduces the overall loop count significantly. */ 121 * reduces the overall loop count significantly. */
122int m4a_check_sample_offset(demux_res_t *demux_res, uint32_t frame, uint32_t *start) 122int m4a_check_sample_offset(demux_res_t *demux_res, uint32_t frame, uint32_t *start)
123{ 123{
@@ -139,9 +139,9 @@ int m4a_check_sample_offset(demux_res_t *demux_res, uint32_t frame, uint32_t *st
139 139
140/* Seek to desired sound sample location. Return 1 on success (and modify 140/* Seek to desired sound sample location. Return 1 on success (and modify
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, int* lookup_table_idx) 144 uint32_t* current_sample, uint32_t* 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;
@@ -257,7 +257,7 @@ unsigned int m4a_seek(demux_res_t* demux_res, stream_t* stream,
257 * 1) the lookup_table array contains the file offset for the first sample 257 * 1) the lookup_table array contains the file offset for the first sample
258 * of each chunk. 258 * of each chunk.
259 * 259 *
260 * 2) the time_to_sample array contains the duration (in sound samples) 260 * 2) the time_to_sample array contains the duration (in sound samples)
261 * of each sample of data. 261 * of each sample of data.
262 * 262 *
263 * Locate the chunk containing location (using lookup_table), find the first 263 * Locate the chunk containing location (using lookup_table), find the first
@@ -265,8 +265,8 @@ unsigned int m4a_seek(demux_res_t* demux_res, stream_t* stream,
265 * calculate the sound_samples_done value. 265 * calculate the sound_samples_done value.
266 */ 266 */
267unsigned 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,
268 uint32_t file_loc, uint64_t* sound_samples_done, 268 uint32_t file_loc, uint64_t* sound_samples_done,
269 int* current_sample, int* lookup_table_idx) 269 uint32_t* current_sample, uint32_t* lookup_table_idx)
270{ 270{
271 uint32_t i; 271 uint32_t i;
272 uint32_t chunk_sample = 0; 272 uint32_t chunk_sample = 0;
@@ -276,7 +276,7 @@ unsigned int m4a_seek_raw(demux_res_t* demux_res, stream_t* stream,
276 uint32_t tmp_cnt; 276 uint32_t tmp_cnt;
277 uint32_t new_pos; 277 uint32_t new_pos;
278 278
279 /* We know the desired byte offset, search for the chunk right before. 279 /* We know the desired byte offset, search for the chunk right before.
280 * Return the associated sample to this chunk as chunk_sample. */ 280 * Return the associated sample to this chunk as chunk_sample. */
281 for (i=0; i < demux_res->num_lookup_table; ++i) 281 for (i=0; i < demux_res->num_lookup_table; ++i)
282 { 282 {
@@ -287,7 +287,7 @@ unsigned int m4a_seek_raw(demux_res_t* demux_res, stream_t* stream,
287 *lookup_table_idx = i; 287 *lookup_table_idx = i;
288 chunk_sample = demux_res->lookup_table[i].sample; 288 chunk_sample = demux_res->lookup_table[i].sample;
289 new_pos = demux_res->lookup_table[i].offset; 289 new_pos = demux_res->lookup_table[i].offset;
290 290
291 /* Get sound sample offset. */ 291 /* Get sound sample offset. */
292 i = 0; 292 i = 0;
293 time_to_sample_t *tab2 = demux_res->time_to_sample; 293 time_to_sample_t *tab2 = demux_res->time_to_sample;
@@ -306,12 +306,12 @@ unsigned int m4a_seek_raw(demux_res_t* demux_res, stream_t* stream,
306 } 306 }
307 307
308 /* Go to the new file position. */ 308 /* Go to the new file position. */
309 if (stream->ci->seek_buffer(new_pos)) 309 if (stream->ci->seek_buffer(new_pos))
310 { 310 {
311 *sound_samples_done = new_sound_sample; 311 *sound_samples_done = new_sound_sample;
312 *current_sample = chunk_sample; 312 *current_sample = chunk_sample;
313 return 1; 313 return 1;
314 } 314 }
315 315
316 return 0; 316 return 0;
317} 317}
diff --git a/lib/rbcodec/codecs/libm4a/m4a.h b/lib/rbcodec/codecs/libm4a/m4a.h
index bcc32f53bb..7120f8b4c6 100644
--- a/lib/rbcodec/codecs/libm4a/m4a.h
+++ b/lib/rbcodec/codecs/libm4a/m4a.h
@@ -45,13 +45,13 @@ typedef struct {
45 45
46typedef uint32_t fourcc_t; 46typedef uint32_t fourcc_t;
47 47
48typedef struct 48typedef struct
49{ 49{
50 uint32_t first_chunk; 50 uint32_t first_chunk;
51 uint32_t num_samples; 51 uint32_t num_samples;
52} sample_to_chunk_t; 52} sample_to_chunk_t;
53 53
54typedef struct 54typedef struct
55{ 55{
56 uint32_t sample_count; 56 uint32_t sample_count;
57 uint32_t sample_duration; 57 uint32_t sample_duration;
@@ -73,10 +73,10 @@ typedef struct
73 73
74 int32_t sample_to_chunk_offset; 74 int32_t sample_to_chunk_offset;
75 uint32_t num_sample_to_chunks; 75 uint32_t num_sample_to_chunks;
76 76
77 sample_offset_t *lookup_table; 77 sample_offset_t *lookup_table;
78 uint32_t num_lookup_table; 78 uint32_t num_lookup_table;
79 79
80 time_to_sample_t *time_to_sample; 80 time_to_sample_t *time_to_sample;
81 uint32_t num_time_to_samples; 81 uint32_t num_time_to_samples;
82 82
@@ -130,10 +130,10 @@ int stream_eof(stream_t *stream);
130void stream_create(stream_t *stream,struct codec_api* ci); 130void stream_create(stream_t *stream,struct codec_api* ci);
131unsigned int get_sample_offset(demux_res_t *demux_res, uint32_t sample); 131unsigned int get_sample_offset(demux_res_t *demux_res, uint32_t sample);
132unsigned int m4a_seek (demux_res_t* demux_res, stream_t* stream, 132unsigned int m4a_seek (demux_res_t* demux_res, stream_t* stream,
133 uint64_t sound_sample_loc, uint64_t* sound_samples_done, 133 uint64_t sound_sample_loc, uint64_t* sound_samples_done,
134 int* current_sample, int* lookup_table_idx); 134 uint32_t* current_sample, uint32_t* lookup_table_idx);
135unsigned int m4a_seek_raw (demux_res_t* demux_res, stream_t* stream, 135unsigned int m4a_seek_raw (demux_res_t* demux_res, stream_t* stream,
136 uint32_t file_loc, uint64_t* sound_samples_done, int* current_sample, int* lookup_table_idx); 136 uint32_t file_loc, uint64_t* sound_samples_done, uint32_t* current_sample, uint32_t* lookup_table_idx);
137int m4a_check_sample_offset(demux_res_t *demux_res, uint32_t frame, uint32_t *start); 137int m4a_check_sample_offset(demux_res_t *demux_res, uint32_t frame, uint32_t *start);
138 138
139#endif /* STREAM_H */ 139#endif /* STREAM_H */