summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@rockbox.org>2006-03-25 18:37:31 +0000
committerBrandon Low <lostlogic@rockbox.org>2006-03-25 18:37:31 +0000
commita9c168834d4fc88c4578c23747f2f7f72a19bb9c (patch)
treec4c586c45e3a9c64bd8b1c79680b954fab5ebe8a /apps
parent62f5194df2a618f7cb4a29c6acc65bfefc246450 (diff)
downloadrockbox-a9c168834d4fc88c4578c23747f2f7f72a19bb9c.tar.gz
rockbox-a9c168834d4fc88c4578c23747f2f7f72a19bb9c.zip
Fix lockups people have been having with track skipping during buffer fill, this is a reversion of a previous commit pending more fixes to playback engine
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9250 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/pcmbuf.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c
index 2d61f238b6..41719d8efc 100644
--- a/apps/pcmbuf.c
+++ b/apps/pcmbuf.c
@@ -401,6 +401,8 @@ void pcmbuf_pause(bool pause) {
401/* Force playback. */ 401/* Force playback. */
402void pcmbuf_play_start(void) 402void pcmbuf_play_start(void)
403{ 403{
404 mutex_lock(&pcmbuf_mutex);
405
404 if (!pcm_is_playing() && pcmbuf_unplayed_bytes) 406 if (!pcm_is_playing() && pcmbuf_unplayed_bytes)
405 { 407 {
406 /** Prevent a very tiny pop from happening by muting audio 408 /** Prevent a very tiny pop from happening by muting audio
@@ -415,6 +417,8 @@ void pcmbuf_play_start(void)
415 /* Now unmute the audio. */ 417 /* Now unmute the audio. */
416 pcm_mute(false); 418 pcm_mute(false);
417 } 419 }
420
421 mutex_unlock(&pcmbuf_mutex);
418} 422}
419 423
420/** 424/**
@@ -422,6 +426,8 @@ void pcmbuf_play_start(void)
422 */ 426 */
423static void pcmbuf_flush_fillpos(void) 427static void pcmbuf_flush_fillpos(void)
424{ 428{
429 mutex_lock(&pcmbuf_mutex);
430
425 if (audiobuffer_fillpos) { 431 if (audiobuffer_fillpos) {
426 /* Never use the last buffer descriptor */ 432 /* Never use the last buffer descriptor */
427 while (pcmbuf_write == pcmbuf_write_end) { 433 while (pcmbuf_write == pcmbuf_write_end) {
@@ -438,6 +444,8 @@ static void pcmbuf_flush_fillpos(void)
438 } 444 }
439 pcmbuf_add_chunk(); 445 pcmbuf_add_chunk();
440 } 446 }
447
448 mutex_unlock(&pcmbuf_mutex);
441} 449}
442 450
443/** 451/**