"norewinds=<disable rewinds>");
#define DEFAULT_SINK_NAME "null"
-#define BLOCK_USEC (PA_USEC_PER_SEC * 2)
-#define NOREWINDS_MAX_LATENCY_USEC (50*PA_USEC_PER_MSEC)
+#define BLOCK_USEC (2 * PA_USEC_PER_SEC)
+#define BLOCK_USEC_NOREWINDS (50 * PA_USEC_PER_MSEC)
struct userdata {
pa_core *core;
u->core = m->core;
u->module = m;
u->rtpoll = pa_rtpoll_new();
+ u->block_usec = BLOCK_USEC;
if (pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll) < 0) {
pa_log("pa_thread_mq_init() failed.");
pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);
pa_sink_set_rtpoll(u->sink, u->rtpoll);
- u->block_usec = BLOCK_USEC;
- nbytes = pa_usec_to_bytes(u->block_usec, &u->sink->sample_spec);
-
if(pa_modargs_get_value_boolean(ma, "norewinds", &u->norewinds) < 0){
pa_log("Invalid argument, norewinds expects a boolean value.");
}
+ if (u->norewinds)
+ u->block_usec = BLOCK_USEC_NOREWINDS;
+
+ nbytes = pa_usec_to_bytes(u->block_usec, &u->sink->sample_spec);
+
if(u->norewinds){
pa_sink_set_max_rewind(u->sink, 0);
} else {
goto fail;
}
- if(u->norewinds){
- pa_sink_set_latency_range(u->sink, 0, NOREWINDS_MAX_LATENCY_USEC);
- } else {
- pa_sink_set_latency_range(u->sink, 0, BLOCK_USEC);
- }
+ pa_sink_set_latency_range(u->sink, 0, u->block_usec);
pa_sink_put(u->sink);