diff options
author | waker <wakeroid@gmail.com> | 2012-09-06 20:49:59 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2012-09-06 20:49:59 +0200 |
commit | dad868cf20ffd2d7b510af70d762bbf8c7ed1f38 (patch) | |
tree | 4a3b126a783ded4f969a7c964bda23eddd058ab6 /plugins/alsa | |
parent | a87d6d7c51eabda38b935bc8204a4a28ba1e74d8 (diff) |
alsa: added a hack to avoid releasing device when user is switching tracks
Diffstat (limited to 'plugins/alsa')
-rw-r--r-- | plugins/alsa/alsa.c | 14 |
1 files changed, 13 insertions, 1 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; } |