summaryrefslogtreecommitdiffstats
path: root/apps/codecs/aac.c
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2011-04-19 05:55:54 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2011-04-19 05:55:54 +0000
commit2358fabb709bcadd300c46e11e74d48f2b115d8e (patch)
tree343ac99ac5ffe713319a878ce6fb624973efc7c7 /apps/codecs/aac.c
parent8d1d2f8982a8c68a7572a82ebc8409e257e77994 (diff)
downloadrockbox-2358fabb709bcadd300c46e11e74d48f2b115d8e.tar.gz
rockbox-2358fabb709bcadd300c46e11e74d48f2b115d8e.zip
Optimization to latest aac decoder changes. Significantly reduce loop count in m4a_check_sample_offset() during standard playback. Before this change the loop count increased with each decoded chunk and for each frame.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29750 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/aac.c')
-rw-r--r--apps/codecs/aac.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/codecs/aac.c b/apps/codecs/aac.c
index 6bb5ac50ae..8eb2dfd8ce 100644
--- a/apps/codecs/aac.c
+++ b/apps/codecs/aac.c
@@ -61,6 +61,7 @@ enum codec_status codec_main(void)
NeAACDecFrameInfo frame_info;
NeAACDecHandle decoder;
int err;
+ uint32_t seek_idx = 0;
uint32_t s = 0;
uint32_t sbr_fac = 1;
unsigned char c = 0;
@@ -201,7 +202,8 @@ next_track:
sound_samples_done *= sbr_fac;
elapsed_time = (sound_samples_done * 10) / (ci->id3->frequency / 100);
ci->set_elapsed(elapsed_time);
-
+ seek_idx = 0;
+
if (i == 0)
{
lead_trim = ci->id3->lead_trim;
@@ -215,8 +217,8 @@ next_track:
* "proper" file can have chunks out of order. Why one would want
* 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);
+ */
+ file_offset = m4a_check_sample_offset(&demux_res, i, &seek_idx);
if (file_offset > ci->curpos)
{