diff options
author | waker <wakeroid@gmail.com> | 2011-04-16 19:21:46 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-04-16 19:21:46 +0200 |
commit | 602dc1dcdb9937ac2aaeb28aaedc0cf6d39abaaa (patch) | |
tree | cc0df68ca6d1ddfc44546423cb68ff70fecfac47 /streamer.c | |
parent | 40a48271e6fd9f191c992b65b8cf039aebead381 (diff) |
fixed possible race condition when removing track from playlist
Diffstat (limited to 'streamer.c')
-rw-r--r-- | streamer.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -143,7 +143,9 @@ streamer_start_playback (playItem_t *from, playItem_t *it) { pl_item_unref (playing_track); playing_track = NULL; } + pl_lock (); playlist_track = it; + pl_unlock (); // assign new playing_track = it; if (playing_track) { @@ -545,16 +547,9 @@ streamer_song_removed_notify (playItem_t *it) { if (!mutex) { return; // streamer is not running } - streamer_lock (); if (it == playlist_track) { playlist_track = playlist_track->prev[PL_MAIN]; - // queue new next song for streaming - if (bytes_until_next_song > 0) { - streamer_ringbuf.remaining = bytes_until_next_song; - streamer_move_to_nextsong (0); - } } - streamer_unlock (); } // that must be called after last sample from str_playing_song was done reading |