summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2009-07-06 03:01:41 +0200
committerGravatar waker <wakeroid@gmail.com>2009-07-06 03:01:41 +0200
commitd05d431ebad5767f3afa9b6c76639e83233e2d9c (patch)
tree0ab32f81a39f5ce3fab292892aee97ee1f85e6c5 /main.c
parentb7a872069ad3990b65d8ebe6d53de8768841980f (diff)
fixed inter-thread conflict for codec access
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.c b/main.c
index fd097d5c..985da9f1 100644
--- a/main.c
+++ b/main.c
@@ -18,6 +18,7 @@ int psdl_terminate = 0;
void
psdl_thread (uintptr_t ctx) {
+ codec_init_locking ();
psdl_init ();
while (!psdl_terminate) {
uint32_t msg;
@@ -65,7 +66,9 @@ psdl_thread (uintptr_t ctx) {
case M_SONGSEEK:
if (playlist_current && playlist_current->codec) {
psdl_pause ();
+ codec_lock ();
playlist_current->codec->seek (p1 / 1000.f);
+ codec_unlock ();
psdl_unpause ();
}
break;
@@ -75,6 +78,7 @@ psdl_thread (uintptr_t ctx) {
// handle message pump here
}
psdl_free ();
+ codec_free_locking ();
ps_free ();
}