forked from len0rd/rockbox
Fixed a problem that cpu boost didn't always reset when stopping the
playback. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7153 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a2e8cf713e
commit
2159811c66
2 changed files with 8 additions and 3 deletions
|
|
@ -312,7 +312,7 @@ static void crossfade_start(void)
|
||||||
int bytesleft = pcmbuf_unplayed_bytes;
|
int bytesleft = pcmbuf_unplayed_bytes;
|
||||||
|
|
||||||
crossfade_init = 0;
|
crossfade_init = 0;
|
||||||
if (bytesleft < CHUNK_SIZE * 3) {
|
if (bytesleft < CHUNK_SIZE * 4) {
|
||||||
logf("crossfade rejected");
|
logf("crossfade rejected");
|
||||||
pcmbuf_play_stop();
|
pcmbuf_play_stop();
|
||||||
return ;
|
return ;
|
||||||
|
|
@ -400,6 +400,9 @@ void* pcmbuf_request_buffer(long length, long *realsize)
|
||||||
{
|
{
|
||||||
void *ptr = NULL;
|
void *ptr = NULL;
|
||||||
|
|
||||||
|
if (crossfade_init)
|
||||||
|
crossfade_start();
|
||||||
|
|
||||||
while (audiobuffer_free < length + audiobuffer_fillpos
|
while (audiobuffer_free < length + audiobuffer_fillpos
|
||||||
+ CHUNK_SIZE && !crossfade_active) {
|
+ CHUNK_SIZE && !crossfade_active) {
|
||||||
pcmbuf_boost(false);
|
pcmbuf_boost(false);
|
||||||
|
|
|
||||||
|
|
@ -1192,16 +1192,18 @@ static void audio_stop_playback(void)
|
||||||
{
|
{
|
||||||
paused = false;
|
paused = false;
|
||||||
playing = false;
|
playing = false;
|
||||||
|
filling = false;
|
||||||
ci.stop_codec = true;
|
ci.stop_codec = true;
|
||||||
if (current_fd >= 0) {
|
if (current_fd >= 0) {
|
||||||
close(current_fd);
|
close(current_fd);
|
||||||
current_fd = -1;
|
current_fd = -1;
|
||||||
}
|
}
|
||||||
|
while (codec_loaded)
|
||||||
|
yield();
|
||||||
pcmbuf_play_stop();
|
pcmbuf_play_stop();
|
||||||
pcm_play_pause(true);
|
pcm_play_pause(true);
|
||||||
track_count = 0;
|
track_count = 0;
|
||||||
audio_clear_track_entries();
|
audio_clear_track_entries();
|
||||||
filling = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Request the next track with new codec. */
|
/* Request the next track with new codec. */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue