From e3b0937a4a6f9b79405b5214f7640e0da53236b6 Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Wed, 22 Nov 2006 10:46:38 +0000 Subject: Priority overriding was not working correctly. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11573 a1c6a512-1295-4272-9138-f99709370657 --- apps/pcmbuf.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'apps') diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c index 347a9fa8fb..e87d27f261 100644 --- a/apps/pcmbuf.c +++ b/apps/pcmbuf.c @@ -240,10 +240,14 @@ static void pcmbuf_under_watermark(void) #ifdef HAVE_PRIORITY_SCHEDULING static int old_priority = 0; - if (LOW_DATA(2) && !old_priority && pcm_is_playing()) + if (LOW_DATA(2) && pcm_is_playing()) { - /* Buffer is critically low so override UI priority. */ - old_priority = thread_set_priority(codec_thread_p, PRIORITY_REALTIME); + if (!old_priority) + { + /* Buffer is critically low so override UI priority. */ + old_priority = thread_set_priority(codec_thread_p, + PRIORITY_REALTIME); + } } else if (old_priority) { -- cgit v1.2.3