diff options
author | waker <wakeroid@gmail.com> | 2009-07-06 03:01:41 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2009-07-06 03:01:41 +0200 |
commit | d05d431ebad5767f3afa9b6c76639e83233e2d9c (patch) | |
tree | 0ab32f81a39f5ce3fab292892aee97ee1f85e6c5 /main.c | |
parent | b7a872069ad3990b65d8ebe6d53de8768841980f (diff) |
fixed inter-thread conflict for codec access
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 (); } |