pbuf = GST_PULSERING_BUFFER_CAST (userdata);
psink = GST_PULSESINK_CAST (GST_OBJECT_PARENT (pbuf));
+ GST_LOG_OBJECT (psink, "type %d, idx %u", t, idx);
+
if (t != (PA_SUBSCRIPTION_EVENT_SINK_INPUT | PA_SUBSCRIPTION_EVENT_CHANGE) &&
t != (PA_SUBSCRIPTION_EVENT_SINK_INPUT | PA_SUBSCRIPTION_EVENT_NEW))
return;
pa_threaded_mainloop_lock (psink->mainloop);
+ GST_DEBUG_OBJECT (psink, "setting volume to %f", volume);
+
psink->volume = volume;
psink->volume_set = TRUE;
pbuf = GST_PULSERING_BUFFER_CAST (GST_BASE_AUDIO_SINK (psink)->ringbuffer);
- if (pbuf == NULL)
+ if (pbuf == NULL || pbuf->stream == NULL)
goto unlock;
gst_pulse_cvolume_from_linear (&v, pbuf->sample_spec.channels, volume);
pa_threaded_mainloop_lock (psink->mainloop);
pbuf = GST_PULSERING_BUFFER_CAST (GST_BASE_AUDIO_SINK (psink)->ringbuffer);
- if (pbuf == NULL)
- goto no_buffer;
g_free (pbuf->stream_name);
pbuf->stream_name = g_strdup (t);
- if (gst_pulsering_is_dead (psink, pbuf))
- goto server_dead;
+ if (pbuf == NULL || pbuf->stream == NULL)
+ goto no_buffer;
if (!(o = pa_stream_set_name (pbuf->stream, pbuf->stream_name, NULL, NULL)))
goto name_failed;
GST_DEBUG_OBJECT (psink, "we have no ringbuffer");
goto unlock;
}
-server_dead:
- {
- GST_DEBUG_OBJECT (psink, "the server is dead");
- goto unlock;
- }
name_failed:
{
GST_ELEMENT_ERROR (psink, RESOURCE, FAILED,
pa_threaded_mainloop_lock (psink->mainloop);
pbuf = GST_PULSERING_BUFFER_CAST (GST_BASE_AUDIO_SINK (psink)->ringbuffer);
- if (pbuf == NULL)
+ if (pbuf == NULL || pbuf->stream == NULL)
goto no_buffer;
- if (gst_pulsering_is_dead (psink, pbuf))
- goto server_dead;
-
if (!(o = pa_stream_proplist_update (pbuf->stream, PA_UPDATE_REPLACE,
pl, NULL, NULL)))
goto update_failed;
GST_DEBUG_OBJECT (psink, "we have no ringbuffer");
goto unlock;
}
-server_dead:
- {
- GST_DEBUG_OBJECT (psink, "the server is dead");
- goto unlock;
- }
update_failed:
{
GST_ELEMENT_ERROR (psink, RESOURCE, FAILED,