forked from len0rd/rockbox
Elapsed counter resets correctly when changing tracks.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6771 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
12a0e221de
commit
cf18f96b99
2 changed files with 5 additions and 3 deletions
|
@ -239,6 +239,9 @@ void codec_set_elapsed_callback(unsigned int value)
|
||||||
{
|
{
|
||||||
unsigned int latency;
|
unsigned int latency;
|
||||||
|
|
||||||
|
if (ci.stop_codec)
|
||||||
|
return ;
|
||||||
|
|
||||||
latency = audiobuffer_get_latency();
|
latency = audiobuffer_get_latency();
|
||||||
|
|
||||||
if (value < latency) {
|
if (value < latency) {
|
||||||
|
@ -751,7 +754,7 @@ void audio_play_start(int offset)
|
||||||
buf_widx = 0;
|
buf_widx = 0;
|
||||||
codecbufused = 0;
|
codecbufused = 0;
|
||||||
pcm_set_boost_mode(true);
|
pcm_set_boost_mode(true);
|
||||||
|
|
||||||
fill_bytesleft = codecbuflen;
|
fill_bytesleft = codecbuflen;
|
||||||
filling = true;
|
filling = true;
|
||||||
last_peek_offset = 0;
|
last_peek_offset = 0;
|
||||||
|
|
|
@ -367,8 +367,7 @@ unsigned int audiobuffer_get_latency(void)
|
||||||
int latency;
|
int latency;
|
||||||
|
|
||||||
/* This has to be done better. */
|
/* This has to be done better. */
|
||||||
latency = (PCMBUF_SIZE - audiobuffer_free - audiobuffer_fillpos
|
latency = (PCMBUF_SIZE - audiobuffer_free - CHUNK_SIZE)/4 / (44100/1000);
|
||||||
- CHUNK_SIZE)/4 / (44100/1000);
|
|
||||||
if (latency < 0)
|
if (latency < 0)
|
||||||
latency = 0;
|
latency = 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue