guint event_probe_id;
gulong pad_added_id;
+ guint block_probe_id;
gboolean format_lost;
} GstPulseAudioSink;
GstCaps *caps;
GstPad *sinkpad = NULL;
-#if 0
- if (!blocked) {
- /* Unblocked, don't need to do anything */
- GST_DEBUG_OBJECT (pbin, "unblocked");
- return;
- }
-#endif
-
GST_DEBUG_OBJECT (pbin, "blocked");
GST_PULSE_AUDIO_SINK_LOCK (pbin);
done:
update_eac3_alignment (pbin);
+ pbin->block_probe_id = 0;
GST_PULSE_AUDIO_SINK_UNLOCK (pbin);
- return GST_PROBE_PASS;
+
+ return GST_PROBE_REMOVE;
}
static gboolean
if (gst_event_has_name (event, "pulse-format-lost"))
pbin->format_lost = TRUE;
- if (!gst_pad_is_blocked (pad))
- gst_pad_add_probe (pad, GST_PROBE_TYPE_BLOCK, proxypad_blocked_cb,
+ if (pbin->block_probe_id == 0)
+ pbin->block_probe_id =
+ gst_pad_add_probe (pad, GST_PROBE_TYPE_BLOCK, proxypad_blocked_cb,
gst_object_ref (pbin), (GDestroyNotify) gst_object_unref);
GST_PULSE_AUDIO_SINK_UNLOCK (pbin);
GST_PULSE_AUDIO_SINK_LOCK (pbin);
- if (!gst_pad_is_blocked (pbin->sinkpad))
- gst_pad_add_probe (pbin->sink_proxypad, GST_PROBE_TYPE_BLOCK,
+ if (pbin->block_probe_id == 0)
+ pbin->block_probe_id =
+ gst_pad_add_probe (pbin->sink_proxypad, GST_PROBE_TYPE_BLOCK,
proxypad_blocked_cb, gst_object_ref (pbin),
(GDestroyNotify) gst_object_unref);
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
GST_PULSE_AUDIO_SINK_LOCK (pbin);
- if (gst_pad_is_blocked (pbin->sinkpad)) {
- gst_pad_add_probe (pbin->sink_proxypad, GST_PROBE_TYPE_BLOCK,
- proxypad_blocked_cb, gst_object_ref (pbin),
- (GDestroyNotify) gst_object_unref);
+ if (pbin->block_probe_id) {
+ gst_pad_remove_probe (pbin->sink_proxypad, pbin->block_probe_id);
+ pbin->block_probe_id = 0;
}
GST_PULSE_AUDIO_SINK_UNLOCK (pbin);
break;