- /* if we are in normal case, i.e. have a selector etc, plug fakesink */
- if (select->selector) {
- if (select->srcpad) {
- GST_DEBUG_OBJECT (playbin, "unblocking %" GST_PTR_FORMAT,
- select->srcpad);
- gst_pad_set_blocked_async (select->srcpad, FALSE, selector_blocked,
- NULL);
- }
- /* streaming might error with NOT_LINKED if any of this fails,
- * but at least we tried */
- GST_DEBUG_OBJECT (playbin, "creating fakesink (sinktype:%d)",
- select->type);
- select->fakesink = gst_element_factory_make ("fakesink", "fakesink");
- if (select->fakesink) {
- GST_OBJECT_FLAG_UNSET (select->fakesink, GST_ELEMENT_IS_SINK);
- gst_element_set_state (select->fakesink, GST_STATE_READY);
- if (gst_bin_add (GST_BIN (playbin), select->fakesink)) {
- if (!gst_element_link (select->selector, select->fakesink)) {
- GST_DEBUG_OBJECT (playbin, "could not link fakesink element");
- gst_object_unref (select->fakesink);
- select->fakesink = NULL;
- }
- } else {
- GST_DEBUG_OBJECT (playbin, "could not add fakesink element");
- gst_object_unref (select->fakesink);
- select->fakesink = NULL;
- }
- } else {
- GST_DEBUG_OBJECT (playbin, "failed to create fakesink");
- }
+ if (select->selector && select->sinkpad == NULL) {
+ GST_DEBUG_OBJECT (playbin, "requesting new flushing sink pad");
+ select->sinkpad =
+ gst_play_sink_request_pad (playbin->playsink,
+ GST_PLAY_SINK_TYPE_FLUSHING);
+ res = gst_pad_link (select->srcpad, select->sinkpad);
+ GST_DEBUG_OBJECT (playbin, "linked flushing, result: %d", res);
+ }
+ if (select->srcpad) {
+ GST_DEBUG_OBJECT (playbin, "unblocking %" GST_PTR_FORMAT,
+ select->srcpad);
+ gst_pad_set_blocked_async (select->srcpad, FALSE, selector_blocked,
+ NULL);