summaryrefslogtreecommitdiff
path: root/apps/pcmbuf.c
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/pcmbuf.c
parent62f5194df2a618f7cb4a29c6acc65bfefc246450 (diff)
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/pcmbuf.c')
-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) {
/* Force playback. */
void pcmbuf_play_start(void)
{
+ mutex_lock(&pcmbuf_mutex);
+
if (!pcm_is_playing() && pcmbuf_unplayed_bytes)
{
/** Prevent a very tiny pop from happening by muting audio
@@ -415,6 +417,8 @@ void pcmbuf_play_start(void)
/* Now unmute the audio. */
pcm_mute(false);
}
+
+ mutex_unlock(&pcmbuf_mutex);
}
/**
@@ -422,6 +426,8 @@ void pcmbuf_play_start(void)
*/
static void pcmbuf_flush_fillpos(void)
{
+ mutex_lock(&pcmbuf_mutex);
+
if (audiobuffer_fillpos) {
/* Never use the last buffer descriptor */
while (pcmbuf_write == pcmbuf_write_end) {
@@ -438,6 +444,8 @@ static void pcmbuf_flush_fillpos(void)
}
pcmbuf_add_chunk();
}
+
+ mutex_unlock(&pcmbuf_mutex);
}
/**