mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
We no longer guarantee that an operation object is returned. Need to tweak
some parts to handle this. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@638 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
da90b05785
commit
dc5b2c58dd
1 changed files with 26 additions and 9 deletions
|
|
@ -314,7 +314,10 @@ static void ipol_callback(pa_mainloop_api *m, pa_time_event *e, PA_GCC_UNUSED co
|
||||||
/* pa_log("requesting new ipol data"); */
|
/* pa_log("requesting new ipol data"); */
|
||||||
|
|
||||||
if (s->state == PA_STREAM_READY && !s->ipol_requested) {
|
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;
|
s->ipol_requested = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -374,7 +377,6 @@ void pa_create_stream_callback(pa_pdispatch *pd, uint32_t command, PA_GCC_UNUSED
|
||||||
|
|
||||||
if (s->interpolate) {
|
if (s->interpolate) {
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
pa_operation_unref(pa_stream_get_latency_info(s, NULL, NULL));
|
|
||||||
|
|
||||||
pa_gettimeofday(&tv);
|
pa_gettimeofday(&tv);
|
||||||
tv.tv_usec += LATENCY_IPOL_INTERVAL_USEC; /* every 100 ms */
|
tv.tv_usec += LATENCY_IPOL_INTERVAL_USEC; /* every 100 ms */
|
||||||
|
|
@ -860,6 +862,7 @@ finish:
|
||||||
|
|
||||||
pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata) {
|
pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata) {
|
||||||
pa_operation *o;
|
pa_operation *o;
|
||||||
|
pa_operation *lo;
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
|
|
@ -891,7 +894,9 @@ pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, voi
|
||||||
pa_pstream_send_tagstruct(s->context->pstream, t);
|
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_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);
|
return pa_operation_ref(o);
|
||||||
}
|
}
|
||||||
|
|
@ -921,8 +926,12 @@ pa_operation* pa_stream_flush(pa_stream *s, pa_stream_success_cb_t cb, void *use
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
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)))
|
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));
|
pa_operation *lo;
|
||||||
|
lo = pa_stream_get_latency_info(s, NULL, NULL);
|
||||||
|
if (lo)
|
||||||
|
pa_operation_unref(lo);
|
||||||
|
}
|
||||||
|
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
@ -932,8 +941,12 @@ pa_operation* pa_stream_prebuf(pa_stream *s, pa_stream_success_cb_t cb, void *us
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE);
|
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)))
|
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));
|
pa_operation *lo;
|
||||||
|
lo = pa_stream_get_latency_info(s, NULL, NULL);
|
||||||
|
if (lo)
|
||||||
|
pa_operation_unref(lo);
|
||||||
|
}
|
||||||
|
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
@ -943,8 +956,12 @@ pa_operation* pa_stream_trigger(pa_stream *s, pa_stream_success_cb_t cb, void *u
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE);
|
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)))
|
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));
|
pa_operation *lo;
|
||||||
|
lo = pa_stream_get_latency_info(s, NULL, NULL);
|
||||||
|
if (lo)
|
||||||
|
pa_operation_unref(lo);
|
||||||
|
}
|
||||||
|
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue