diff options
-rw-r--r-- | plugins/alsa/alsa.c | 14 | ||||
-rw-r--r-- | streamer.c | 4 |
2 files changed, 14 insertions, 4 deletions
diff --git a/plugins/alsa/alsa.c b/plugins/alsa/alsa.c index cca4dde9..cbc597ab 100644 --- a/plugins/alsa/alsa.c +++ b/plugins/alsa/alsa.c @@ -576,8 +576,20 @@ palsa_stop (void) { #endif UNLOCK; deadbeef->streamer_reset (1); - if (deadbeef->conf_get_int ("alsa.freeonstop", 0)) { + DB_playItem_t *ts = deadbeef->streamer_get_streaming_track (); + DB_playItem_t *tp = deadbeef->streamer_get_playing_track (); + if (deadbeef->conf_get_int ("alsa.freeonstop", 0) && !ts && !tp) { palsa_free (); + printf ("\033[0;31malsa released!\033[37;0m\n"); + } + else { + printf ("\033[0;32malsa not released!\033[37;0m\n"); + } + if (tp) { + deadbeef->pl_item_unref (tp); + } + if (ts) { + deadbeef->pl_item_unref (ts); } return 0; } @@ -1220,9 +1220,6 @@ streamer_thread (void *ctx) { bytes_until_next_song = -1; trace ("nextsong=-2\n"); nextsong = -1; - streamer_unlock (); - output->stop (); - streamer_lock (); if (playing_track) { trace ("sending songfinished to plugins [1]\n"); send_songfinished (playing_track); @@ -1240,6 +1237,7 @@ streamer_thread (void *ctx) { pl_item_unref (from); } streamer_unlock (); + output->stop (); continue; } else if (output->state () == OUTPUT_STATE_STOPPED) { |