diff options
Diffstat (limited to 'lib/rbcodec/codecs/aac.c')
-rw-r--r-- | lib/rbcodec/codecs/aac.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/rbcodec/codecs/aac.c b/lib/rbcodec/codecs/aac.c index 11a84cfa24..15c75708e1 100644 --- a/lib/rbcodec/codecs/aac.c +++ b/lib/rbcodec/codecs/aac.c @@ -28,7 +28,7 @@ CODEC_HEADER /* The maximum buffer size handled by faad. 12 bytes are required by libfaad - * as headroom (see libfaad/bits.c). FAAD_BYTE_BUFFER_SIZE bytes are buffered + * as headroom (see libfaad/bits.c). FAAD_BYTE_BUFFER_SIZE bytes are buffered * for each frame. */ #define FAAD_BYTE_BUFFER_SIZE (2048-12) @@ -62,7 +62,7 @@ enum codec_status codec_run(void) int framelength; int lead_trim = 0; unsigned int frame_samples; - unsigned int i; + uint32_t i; unsigned char* buffer; NeAACDecFrameInfo frame_info; NeAACDecHandle decoder; @@ -129,7 +129,7 @@ enum codec_status codec_run(void) #endif i = 0; - + if (param) { elapsed_time = param; action = CODEC_ACTION_SEEK_TIME; @@ -138,7 +138,7 @@ enum codec_status codec_run(void) * upsampling files the resulting sound_samples_done must be expanded * by a factor of 2. This is done via using sbr_fac. */ if (m4a_seek_raw(&demux_res, &input_stream, file_offset, - &sound_samples_done, (int*) &i, &seek_idx)) { + &sound_samples_done, &i, &seek_idx)) { sound_samples_done *= sbr_fac; } else { sound_samples_done = 0; @@ -151,8 +151,8 @@ enum codec_status codec_run(void) } ci->set_elapsed(elapsed_time); - - if (i == 0) + + if (i == 0) { lead_trim = ci->id3->lead_trim; } @@ -168,17 +168,17 @@ enum codec_status codec_run(void) /* Deal with any pending seek requests */ if (action == CODEC_ACTION_SEEK_TIME) { /* Seek to the desired time position. Important: When seeking in SBR - * upsampling files the seek_time must be divided by 2 when calling - * m4a_seek and the resulting sound_samples_done must be expanded + * upsampling files the seek_time must be divided by 2 when calling + * m4a_seek and the resulting sound_samples_done must be expanded * by a factor 2. This is done via using sbr_fac. */ if (m4a_seek(&demux_res, &input_stream, (uint64_t) param * ci->id3->frequency / sbr_fac / 1000ULL, - &sound_samples_done, (int*) &i, &seek_idx)) { + &sound_samples_done, &i, &seek_idx)) { sound_samples_done *= sbr_fac; elapsed_time = sound_samples_done * 1000LL / ci->id3->frequency; ci->set_elapsed(elapsed_time); - if (i == 0) + if (i == 0) { lead_trim = ci->id3->lead_trim; } @@ -190,9 +190,9 @@ enum codec_status codec_run(void) action = CODEC_ACTION_NULL; /* There can be gaps between chunks, so skip ahead if needed. It - * doesn't seem to happen much, but it probably means that a + * doesn't seem to happen much, but it probably means that a * "proper" file can have chunks out of order. Why one would want - * that an good question (but files with gaps do exist, so who + * that an good question (but files with gaps do exist, so who * knows?), so we don't support that - for now, at least. */ file_offset = m4a_check_sample_offset(&demux_res, i, &seek_idx); @@ -219,7 +219,7 @@ enum codec_status codec_run(void) /* Output the audio */ ci->yield(); - + frame_samples = frame_info.samples >> 1; if (empty_first_frame) @@ -238,7 +238,7 @@ enum codec_status codec_run(void) /* Gather number of samples for the decoded frame. */ framelength = frame_samples - lead_trim; - + if (i == demux_res.num_sample_byte_sizes - 1) { // Size of the last frame |