diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2018-10-15 17:59:13 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2018-10-29 19:50:34 +0100 |
commit | 20b91a83d3078eeabc02a4d214f6d44c64282f89 (patch) | |
tree | 00a182ef2240e6edc5a88ae4cf037479f5fa042c /lib/rbcodec/codecs/aac.c | |
parent | 0120ecd651a2ff3f8e202a704d6e73b705cf81d0 (diff) | |
download | rockbox-20b91a83d3078eeabc02a4d214f6d44c64282f89.tar.gz rockbox-20b91a83d3078eeabc02a4d214f6d44c64282f89.zip |
codecs: Fix elapsed time calculation for large files
In particular, this solves seeking glitches seen in ~6 hr mp3 files.
(Patch taken from Igor Poretsky's tree)
Change-Id: Id65b6726146b6d2d1a223e90b88e401d1b2d597a
Diffstat (limited to 'lib/rbcodec/codecs/aac.c')
-rw-r--r-- | lib/rbcodec/codecs/aac.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/rbcodec/codecs/aac.c b/lib/rbcodec/codecs/aac.c index 5e289f0306..c00946f227 100644 --- a/lib/rbcodec/codecs/aac.c +++ b/lib/rbcodec/codecs/aac.c | |||
@@ -141,8 +141,7 @@ enum codec_status codec_run(void) | |||
141 | sound_samples_done = 0; | 141 | sound_samples_done = 0; |
142 | } | 142 | } |
143 | NeAACDecPostSeekReset(decoder, i); | 143 | NeAACDecPostSeekReset(decoder, i); |
144 | elapsed_time = (sound_samples_done * 10) / | 144 | elapsed_time = sound_samples_done * 1000LL / ci->id3->frequency; |
145 | (ci->id3->frequency / 100); | ||
146 | } else if (param) { | 145 | } else if (param) { |
147 | elapsed_time = param; | 146 | elapsed_time = param; |
148 | action = CODEC_ACTION_SEEK_TIME; | 147 | action = CODEC_ACTION_SEEK_TIME; |
@@ -176,7 +175,7 @@ enum codec_status codec_run(void) | |||
176 | (param/10/sbr_fac)*(ci->id3->frequency/100), | 175 | (param/10/sbr_fac)*(ci->id3->frequency/100), |
177 | &sound_samples_done, (int*) &i)) { | 176 | &sound_samples_done, (int*) &i)) { |
178 | sound_samples_done *= sbr_fac; | 177 | sound_samples_done *= sbr_fac; |
179 | elapsed_time = (sound_samples_done * 10) / (ci->id3->frequency / 100); | 178 | elapsed_time = sound_samples_done * 1000LL / ci->id3->frequency; |
180 | ci->set_elapsed(elapsed_time); | 179 | ci->set_elapsed(elapsed_time); |
181 | seek_idx = 0; | 180 | seek_idx = 0; |
182 | 181 | ||