summaryrefslogtreecommitdiff
path: root/lib/rbcodec
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec')
-rw-r--r--lib/rbcodec/codecs/aac.c7
-rw-r--r--lib/rbcodec/codecs/libm4a/m4a.c15
2 files changed, 10 insertions, 12 deletions
diff --git a/lib/rbcodec/codecs/aac.c b/lib/rbcodec/codecs/aac.c
index 8b06f5aa0e..0a4313e69e 100644
--- a/lib/rbcodec/codecs/aac.c
+++ b/lib/rbcodec/codecs/aac.c
@@ -202,12 +202,7 @@ enum codec_status codec_run(void)
202 { 202 {
203 ci->advance_buffer(file_offset - ci->curpos); 203 ci->advance_buffer(file_offset - ci->curpos);
204 } 204 }
205 else if (file_offset == 0) 205
206 {
207 LOGF("AAC: get_sample_offset error\n");
208 return CODEC_ERROR;
209 }
210
211 /* Request the required number of bytes from the input buffer */ 206 /* Request the required number of bytes from the input buffer */
212 buffer=ci->request_buffer(&n, FAAD_BYTE_BUFFER_SIZE); 207 buffer=ci->request_buffer(&n, FAAD_BYTE_BUFFER_SIZE);
213 208
diff --git a/lib/rbcodec/codecs/libm4a/m4a.c b/lib/rbcodec/codecs/libm4a/m4a.c
index 17af4cfece..958d0b1575 100644
--- a/lib/rbcodec/codecs/libm4a/m4a.c
+++ b/lib/rbcodec/codecs/libm4a/m4a.c
@@ -122,16 +122,19 @@ void stream_create(stream_t *stream,struct codec_api* ci)
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{
124 uint32_t i = *start; 124 uint32_t i = *start;
125 for (i=0; i<demux_res->num_lookup_table; ++i) 125 for (;i < demux_res->num_lookup_table; ++i)
126 { 126 {
127 if (demux_res->lookup_table[i].sample > frame || 127 if (demux_res->lookup_table[i].sample > frame)
128 demux_res->lookup_table[i].offset == 0)
129 return -1;
130 if (demux_res->lookup_table[i].sample == frame)
131 break; 128 break;
129
130 if (demux_res->lookup_table[i].sample == frame)
131 {
132 *start = i;
133 return demux_res->lookup_table[i].offset;
134 }
132 } 135 }
133 *start = i; 136 *start = i;
134 return demux_res->lookup_table[i].offset; 137 return -1;
135} 138}
136 139
137/* 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