From 3e33a0f8ee62dc37e6e028e5dcb39b91e0e0d154 Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Tue, 5 Jul 2005 15:51:59 +0000 Subject: 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 --- apps/playback.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'apps') 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(); } -- cgit v1.2.3