From a0099b998c6c8c546b7c5e72258f8eec2bfd0150 Mon Sep 17 00:00:00 2001 From: Themaister Date: Fri, 14 May 2010 05:30:14 +0200 Subject: OSS plugin does not shut down the audio stream on a pause or stop. This causes annoying latency when changing a song, or pausing, etc. This fix should make sure that it is done. --- plugins/oss/oss.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'plugins/oss') diff --git a/plugins/oss/oss.c b/plugins/oss/oss.c index c98a9f83..ee0ca8aa 100644 --- a/plugins/oss/oss.c +++ b/plugins/oss/oss.c @@ -185,7 +185,7 @@ static int oss_stop (void) { state = OUTPUT_STATE_STOPPED; deadbeef->streamer_reset (1); - return 0; + return oss_free(); } static int @@ -195,14 +195,21 @@ oss_pause (void) { } // set pause state state = OUTPUT_STATE_PAUSED; - return 0; + return oss_free(); } static int oss_unpause (void) { // unset pause state if (state == OUTPUT_STATE_PAUSED) { - state = OUTPUT_STATE_PLAYING; + + if (!oss_tid) { + if(oss_init() < 0) { + return -1; + } + } + + state = OUTPUT_STATE_PLAYING; } return 0; } -- cgit v1.2.3