summaryrefslogtreecommitdiff
path: root/plugins/pulse/pulse.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-02-08 19:42:09 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-02-08 19:42:09 +0100
commitf9edf7a929533409b8417ac788e2a5cca06c166a (patch)
treec33fd53581064baf617e6931352e091a93e03f30 /plugins/pulse/pulse.c
parentcbeb0f75ad5ef44f1083b547721d6aa0639d84c5 (diff)
fixed stuttering at start of track in pulse plugin
Diffstat (limited to 'plugins/pulse/pulse.c')
-rw-r--r--plugins/pulse/pulse.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/plugins/pulse/pulse.c b/plugins/pulse/pulse.c
index 24083d85..96db9c8b 100644
--- a/plugins/pulse/pulse.c
+++ b/plugins/pulse/pulse.c
@@ -210,27 +210,26 @@ static void pulse_thread(void *context)
while (!pulse_terminate)
{
- if (state != OUTPUT_STATE_PLAYING)
+ if (state != OUTPUT_STATE_PLAYING || !deadbeef->streamer_ok_to_read (-1))
{
usleep(1000);
+ continue;
}
- else
+
+ char buf[buffer_size];
+ 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);
+
+ if (res < 0)
{
- char buf[buffer_size];
- 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);
-
- if (res < 0)
- {
- fprintf(stderr, "pulse: failed to write buffer\n");
- pulse_tid = 0;
- pulse_free ();
- break;
- }
+ fprintf(stderr, "pulse: failed to write buffer\n");
+ pulse_tid = 0;
+ pulse_free ();
+ break;
}
}
}