diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-08-25 21:01:02 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-08-25 21:01:02 +0200 |
commit | f947948d8db225ec89cb219c611f20b9f98c51cb (patch) | |
tree | 3ba6795071ebb0c2c32a499303407daff9ad8b68 /plugins/pulse | |
parent | ed3630137c570df8b9c7c6855d168f078775c4ed (diff) |
removed volume hack from pulseaudio
Diffstat (limited to 'plugins/pulse')
-rw-r--r-- | plugins/pulse/pulse.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/plugins/pulse/pulse.c b/plugins/pulse/pulse.c index cd8f426c..ffb92b07 100644 --- a/plugins/pulse/pulse.c +++ b/plugins/pulse/pulse.c @@ -143,11 +143,8 @@ static int pulse_play(void) static int pulse_stop(void) { - float vol = deadbeef->volume_get_amp(); - deadbeef->volume_set_amp(0.0); state = OUTPUT_STATE_STOPPED; deadbeef->streamer_reset(1); - deadbeef->volume_set_amp(vol); return 0; } @@ -218,17 +215,18 @@ static void pulse_thread(void *context) { if (state != OUTPUT_STATE_PLAYING || !deadbeef->streamer_ok_to_read (-1)) { - usleep(1000); + usleep(10000); continue; } char buf[buffer_size]; + deadbeef->mutex_lock(mutex); pulse_callback (buf, sizeof (buf)); int error; - deadbeef->mutex_lock(mutex); int res = pa_simple_write(s, buf, sizeof (buf), &error); deadbeef->mutex_unlock(mutex); + usleep (1000); if (res < 0) { @@ -242,12 +240,6 @@ static void pulse_thread(void *context) static void pulse_callback(char *stream, int len) { - if (!deadbeef->streamer_ok_to_read (len)) - { - memset (stream, 0, len); - return; - } - int bytesread = deadbeef->streamer_read(stream, len); int16_t ivolume = deadbeef->volume_get_amp() * 1000; |