summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2005-07-05 15:51:59 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2005-07-05 15:51:59 +0000
commit3e33a0f8ee62dc37e6e028e5dcb39b91e0e0d154 (patch)
tree1bcb2fbcda422a064c9d55df3ac7d517693f72f0 /apps
parentd6e79424264147e52f70d9ed34b80e34a9d3c23b (diff)
downloadrockbox-3e33a0f8ee62dc37e6e028e5dcb39b91e0e0d154.tar.gz
rockbox-3e33a0f8ee62dc37e6e028e5dcb39b91e0e0d154.tar.bz2
rockbox-3e33a0f8ee62dc37e6e028e5dcb39b91e0e0d154.zip
More crossfade adjustments. Now crossfade should work shortly even if
the disk was not spinning while a new track was loaded from the disk. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7028 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/playback.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/playback.c b/apps/playback.c
index e251a1ee89..8186cf3191 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -614,13 +614,16 @@ void codec_track_changed(void)
queue_post(&audio_queue, AUDIO_TRACK_CHANGED, 0);
}
+/* Give codecs or file buffering the right amount of processing time
+ to prevent pcm audio buffer from going empty. */
void yield_codecs(void)
{
yield();
if (!pcm_is_playing())
sleep(5);
- while (pcm_is_lowdata() && !ci.stop_codec &&
- playing && queue_empty(&audio_queue) && codecbufused > (128*1024))
+ while ((pcm_is_crossfade_active() || pcm_is_lowdata())
+ && !ci.stop_codec && playing && queue_empty(&audio_queue)
+ && codecbufused > (128*1024))
yield();
}