From bf397b5635fb619cd782e9496059fb5082b3ae40 Mon Sep 17 00:00:00 2001 From: Brandon Low Date: Sat, 15 Apr 2006 09:19:49 +0000 Subject: [PATCH] Remove an unneeded WPS update signal. Make the codec thread more polite about requesting buffering. Prevent more Codec failure pops when the codec was _asked_ to stop. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9674 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/apps/playback.c b/apps/playback.c index cb2cbac82e..1aa595b131 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -522,8 +522,9 @@ size_t codec_filebuf_callback(void *ptr, size_t size) /* Let the disk buffer catch fill until enough data is available */ while (copy_n > cur_ti->available) { - queue_post(&audio_queue, Q_AUDIO_FILL_BUFFER, 0); - yield(); + if (!filling) + queue_post(&audio_queue, Q_AUDIO_FILL_BUFFER, 0); + sleep(1); if (ci.stop_codec || ci.new_track) return 0; } @@ -604,8 +605,9 @@ void* codec_request_buffer_callback(size_t *realsize, size_t reqsize) } while (copy_n > cur_ti->available) { - queue_post(&audio_queue, Q_AUDIO_FILL_BUFFER, 0); - yield(); + if (!filling) + queue_post(&audio_queue, Q_AUDIO_FILL_BUFFER, 0); + sleep(1); if (ci.stop_codec || ci.new_track) { *realsize = 0; return NULL; @@ -1927,7 +1929,6 @@ static void initiate_track_change(long direction) { playlist_end = false; ci.new_track += direction; - track_changed = true; } static void initiate_dir_change(long direction) @@ -2101,8 +2102,12 @@ void codec_thread(void) } if (audio_codec_loaded) - if (!playing && ci.stop_codec) - pcmbuf_play_stop(); + if (ci.stop_codec) + { + status = CODEC_OK; + if (!playing) + pcmbuf_play_stop(); + } audio_codec_loaded = false;