+2008-09-27 Jan Schmidt <jan.schmidt@sun.com>
+
+ * ext/pulse/pulsesink.c:
+ Fix problems with pulsesink randomly erroring with code 'OK' after a
+ format change on the stream by waiting when disconnecting the stream.
+
2008-09-26 Wim Taymans <wim.taymans@collabora.co.uk>
* gst/rtp/gstrtpamrdepay.c: (gst_rtp_amr_depay_class_init),
{
if (pulsesink->stream) {
pa_stream_disconnect (pulsesink->stream);
+ pa_threaded_mainloop_wait (pulsesink->mainloop);
pa_stream_unref (pulsesink->stream);
pulsesink->stream = NULL;
}
{
GstPulseSink *pulsesink = GST_PULSESINK (asink);
gchar *name = gst_pulse_client_name ();
+ pa_context_state_t state;
pa_threaded_mainloop_lock (pulsesink->mainloop);
/* Wait until the context is ready */
pa_threaded_mainloop_wait (pulsesink->mainloop);
- if (pa_context_get_state (pulsesink->context) != PA_CONTEXT_READY) {
+ state = pa_context_get_state (pulsesink->context);
+ if (state != PA_CONTEXT_READY) {
+ GST_DEBUG_OBJECT (pulsesink, "Context state was not READY. Got: %d", state);
GST_ELEMENT_ERROR (pulsesink, RESOURCE, FAILED, ("Failed to connect: %s",
pa_strerror (pa_context_errno (pulsesink->context))), (NULL));
goto unlock_and_fail;
{
pa_buffer_attr buf_attr;
pa_channel_map channel_map;
+ pa_stream_state_t s_state;
GstPulseSink *pulsesink = GST_PULSESINK (asink);
if (!gst_pulse_fill_sample_spec (spec, &pulsesink->sample_spec)) {
/* Wait until the stream is ready */
pa_threaded_mainloop_wait (pulsesink->mainloop);
- if (pa_stream_get_state (pulsesink->stream) != PA_STREAM_READY) {
+ s_state = pa_stream_get_state (pulsesink->stream);
+ if (s_state != PA_STREAM_READY) {
+ GST_DEBUG_OBJECT (pulsesink, "Stream state was not READY. Got: %d",
+ s_state);
GST_ELEMENT_ERROR (pulsesink, RESOURCE, FAILED,
("Failed to connect stream: %s",
pa_strerror (pa_context_errno (pulsesink->context))), (NULL));