diff options
author | waker <wakeroid@gmail.com> | 2011-01-22 19:42:56 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-01-22 19:42:56 +0100 |
commit | 4cab10f95672f8950e9c1191a9d021dfe0ca87e7 (patch) | |
tree | 9ffaaa36568f0290b47ef2e9b586872ecdc04250 /streamer.c | |
parent | a07ddff5c150c5402fd9281c64ce578906f7ab6a (diff) |
fix race condition between streamer and output plugin, causing streamer to hang during track transition
Diffstat (limited to 'streamer.c')
-rw-r--r-- | streamer.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -955,7 +955,9 @@ streamer_thread (void *ctx) { memcpy (&prevfmt, &output->fmt, sizeof (ddb_waveformat_t)); if (memcmp (&output_format, &fileinfo->fmt, sizeof (ddb_waveformat_t))) { memcpy (&output_format, &fileinfo->fmt, sizeof (ddb_waveformat_t)); + streamer_unlock (); // prevent race-condition in output plugins output->setformat (&fileinfo->fmt); + streamer_lock (); // check if the format actually changed if (memcmp (&output->fmt, &prevfmt, sizeof (ddb_waveformat_t))) { // restart streaming of current track |