diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index e441465e9e..3ad7836220 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -3511,6 +3511,7 @@ void gst_play_sink_refresh_pad (GstPlaySink * playsink, GstPad * pad, GstPlaySinkType type) { + gulong *block_id; GST_DEBUG_OBJECT (playsink, "refresh pad %" GST_PTR_FORMAT, pad); GST_PLAY_SINK_LOCK (playsink); @@ -3518,20 +3519,25 @@ gst_play_sink_refresh_pad (GstPlaySink * playsink, GstPad * pad, if (type != GST_PLAY_SINK_TYPE_VIDEO_RAW && type != GST_PLAY_SINK_TYPE_VIDEO) goto wrong_type; + block_id = &playsink->video_block_id; } else if (pad == playsink->audio_pad) { if (type != GST_PLAY_SINK_TYPE_AUDIO_RAW && type != GST_PLAY_SINK_TYPE_AUDIO) goto wrong_type; + block_id = &playsink->audio_block_id; } else if (pad == playsink->text_pad) { if (type != GST_PLAY_SINK_TYPE_TEXT) goto wrong_type; + block_id = &playsink->text_block_id; } if (type != GST_PLAY_SINK_TYPE_FLUSHING) { GstPad *blockpad = GST_PAD_CAST (gst_proxy_pad_get_internal (GST_PROXY_PAD (pad))); - gst_pad_set_blocked_async (blockpad, TRUE, sinkpad_blocked_cb, playsink); + *block_id = + gst_pad_add_probe (blockpad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM, + sinkpad_blocked_cb, playsink, NULL); PENDING_FLAG_SET (playsink, type); gst_object_unref (blockpad); }