/* pa_log("requesting new ipol data"); */
if (s->state == PA_STREAM_READY && !s->ipol_requested) {
- pa_operation_unref(pa_stream_get_latency_info(s, NULL, NULL));
+ pa_operation *o;
+ o = pa_stream_get_latency_info(s, NULL, NULL);
+ if (o)
+ pa_operation_unref(o);
s->ipol_requested = 1;
}
if (s->interpolate) {
struct timeval tv;
- pa_operation_unref(pa_stream_get_latency_info(s, NULL, NULL));
pa_gettimeofday(&tv);
tv.tv_usec += LATENCY_IPOL_INTERVAL_USEC; /* every 100 ms */
pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata) {
pa_operation *o;
+ pa_operation *lo;
pa_tagstruct *t;
uint32_t tag;
pa_pstream_send_tagstruct(s->context->pstream, t);
pa_pdispatch_register_reply(s->context->pdispatch, tag, DEFAULT_TIMEOUT, pa_stream_simple_ack_callback, o);
- pa_operation_unref(pa_stream_get_latency_info(s, NULL, NULL));
+ lo = pa_stream_get_latency_info(s, NULL, NULL);
+ if (lo)
+ pa_operation_unref(lo);
return pa_operation_ref(o);
}
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
- if ((o = stream_send_simple_command(s, s->direction == PA_STREAM_PLAYBACK ? PA_COMMAND_FLUSH_PLAYBACK_STREAM : PA_COMMAND_FLUSH_RECORD_STREAM, cb, userdata)))
- pa_operation_unref(pa_stream_get_latency_info(s, NULL, NULL));
+ if ((o = stream_send_simple_command(s, s->direction == PA_STREAM_PLAYBACK ? PA_COMMAND_FLUSH_PLAYBACK_STREAM : PA_COMMAND_FLUSH_RECORD_STREAM, cb, userdata))) {
+ pa_operation *lo;
+ lo = pa_stream_get_latency_info(s, NULL, NULL);
+ if (lo)
+ pa_operation_unref(lo);
+ }
return o;
}
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE);
- if ((o = stream_send_simple_command(s, PA_COMMAND_PREBUF_PLAYBACK_STREAM, cb, userdata)))
- pa_operation_unref(pa_stream_get_latency_info(s, NULL, NULL));
+ if ((o = stream_send_simple_command(s, PA_COMMAND_PREBUF_PLAYBACK_STREAM, cb, userdata))) {
+ pa_operation *lo;
+ lo = pa_stream_get_latency_info(s, NULL, NULL);
+ if (lo)
+ pa_operation_unref(lo);
+ }
return o;
}
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE);
- if ((o = stream_send_simple_command(s, PA_COMMAND_TRIGGER_PLAYBACK_STREAM, cb, userdata)))
- pa_operation_unref(pa_stream_get_latency_info(s, NULL, NULL));
+ if ((o = stream_send_simple_command(s, PA_COMMAND_TRIGGER_PLAYBACK_STREAM, cb, userdata))) {
+ pa_operation *lo;
+ lo = pa_stream_get_latency_info(s, NULL, NULL);
+ if (lo)
+ pa_operation_unref(lo);
+ }
return o;
}