summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/codecs')
-rw-r--r--lib/rbcodec/codecs/aac.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/rbcodec/codecs/aac.c b/lib/rbcodec/codecs/aac.c
index 7cd6b07775..67cfd09ded 100644
--- a/lib/rbcodec/codecs/aac.c
+++ b/lib/rbcodec/codecs/aac.c
@@ -92,6 +92,8 @@ enum codec_status codec_run(void)
92 92
93 stream_create(&input_stream,ci); 93 stream_create(&input_stream,ci);
94 94
95 ci->seek_buffer(0);
96
95 /* if qtmovie_read returns successfully, the stream is up to 97 /* if qtmovie_read returns successfully, the stream is up to
96 * the movie data, which can be used directly by the decoder */ 98 * the movie data, which can be used directly by the decoder */
97 if (!qtmovie_read(&input_stream, &demux_res)) { 99 if (!qtmovie_read(&input_stream, &demux_res)) {
@@ -146,7 +148,6 @@ enum codec_status codec_run(void)
146 } else { 148 } else {
147 elapsed_time = 0; 149 elapsed_time = 0;
148 sound_samples_done = 0; 150 sound_samples_done = 0;
149 ci->seek_buffer(ci->id3->first_frame_offset);
150 } 151 }
151 152
152 ci->set_elapsed(elapsed_time); 153 ci->set_elapsed(elapsed_time);
@@ -194,13 +195,14 @@ enum codec_status codec_run(void)
194 * doesn't seem to happen much, but it probably means that a 195 * doesn't seem to happen much, but it probably means that a
195 * "proper" file can have chunks out of order. Why one would want 196 * "proper" file can have chunks out of order. Why one would want
196 * that an good question (but files with gaps do exist, so who 197 * that an good question (but files with gaps do exist, so who
197 * knows?), so we don't support that - for now, at least. 198 * knows?), and we might not properly support it.
199 * Metadata can also be placed after audio data so skip back if needed.
198 */ 200 */
199 file_offset = m4a_check_sample_offset(&demux_res, i, &seek_idx); 201 file_offset = m4a_check_sample_offset(&demux_res, i, &seek_idx);
200 202
201 if (file_offset > ci->curpos) 203 if (file_offset > 0 && file_offset != ci->curpos)
202 { 204 {
203 ci->advance_buffer(file_offset - ci->curpos); 205 ci->seek_buffer(file_offset);
204 } 206 }
205 207
206 /* Request the required number of bytes from the input buffer */ 208 /* Request the required number of bytes from the input buffer */