aboutsummaryrefslogtreecommitdiff
path: root/soundout/pulseout.c
diff options
context:
space:
mode:
authorTakamichi Horikawa <takamichiho@gmail.com>2017-07-31 00:36:09 +0900
committerTakamichi Horikawa <takamichiho@gmail.com>2017-07-31 00:36:09 +0900
commit6941bde7796b56b8b60652b059c28db715cbba53 (patch)
tree23c17959a103d99d1700e4ff00a4f269f585b3b4 /soundout/pulseout.c
parent7a79b0bbf2a815b72fc9de976f59fedb4e63ee52 (diff)
autoconf update
Diffstat (limited to 'soundout/pulseout.c')
-rw-r--r--soundout/pulseout.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/soundout/pulseout.c b/soundout/pulseout.c
index 5734991..1104ad0 100644
--- a/soundout/pulseout.c
+++ b/soundout/pulseout.c
@@ -47,7 +47,7 @@ static void pulseout_pause(struct sound_state *ss, int pause, int flush) {
pa_threaded_mainloop_wait(ps->pa_tm);
pa_operation_unref(op_flush);
} else {
- fprintf(stderr, "FLUSH ERR\n");
+ //fprintf(stderr, "FLUSH ERR\n");
}
}
pa_operation *op_cork = pa_stream_cork(ps->pa_s, 0, pulseout_success_cb, ps);
@@ -56,7 +56,7 @@ static void pulseout_pause(struct sound_state *ss, int pause, int flush) {
pa_threaded_mainloop_wait(ps->pa_tm);
pa_operation_unref(op_cork);
} else {
- fprintf(stderr, "CORK ERR\n");
+ //fprintf(stderr, "CORK ERR\n");
}
pa_threaded_mainloop_unlock(ps->pa_tm);
}
@@ -156,7 +156,14 @@ struct sound_state *pulseout_init(
);
if (!ps->pa_s) goto err;
pa_stream_set_write_callback(ps->pa_s, pulseout_cb, ps);
- if (pa_stream_connect_playback(ps->pa_s, 0, 0, 0, 0, 0) < 0) goto err;
+ pa_buffer_attr battr = {
+ .maxlength = -1,
+ .tlength = pa_usec_to_bytes(1000*1000/30, &ss),
+ .prebuf = -1,
+ .minreq = -1,
+ .fragsize = -1,
+ };
+ if (pa_stream_connect_playback(ps->pa_s, 0, &battr, PA_STREAM_ADJUST_LATENCY, 0, 0) < 0) goto err;
return &ps->ss;
err:
pulseout_free(&ps->ss);