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/mpa.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/mpa.c')
-rw-r--r-- | lib/rbcodec/codecs/mpa.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rbcodec/codecs/mpa.c b/lib/rbcodec/codecs/mpa.c index 0e7b4faf4f..e6662ddcbe 100644 --- a/lib/rbcodec/codecs/mpa.c +++ b/lib/rbcodec/codecs/mpa.c | |||
@@ -420,7 +420,7 @@ enum codec_status codec_run(void) | |||
420 | break; | 420 | break; |
421 | } | 421 | } |
422 | 422 | ||
423 | ci->set_elapsed((samplesdone * 1000) / current_frequency); | 423 | ci->set_elapsed((samplesdone * 1000LL) / current_frequency); |
424 | ci->seek_complete(); | 424 | ci->seek_complete(); |
425 | init_mad(); | 425 | init_mad(); |
426 | framelength = 0; | 426 | framelength = 0; |
@@ -508,7 +508,7 @@ enum codec_status codec_run(void) | |||
508 | } | 508 | } |
509 | 509 | ||
510 | samplesdone += framelength; | 510 | samplesdone += framelength; |
511 | ci->set_elapsed((samplesdone * 1000) / current_frequency); | 511 | ci->set_elapsed((samplesdone * 1000LL) / current_frequency); |
512 | } | 512 | } |
513 | 513 | ||
514 | /* wait for synth idle - MT only*/ | 514 | /* wait for synth idle - MT only*/ |