playbin2: return NOT_LINKED for unselected streams

When streams are not selected in the selector, return NOT_LINKED so that
upstream elements can skip decoding. Only do this for audio and video pads
because for text streams the overhead is smaller and they could come from
external files.
This commit is contained in:
Wim Taymans 2009-03-17 11:54:40 +01:00
parent 5021c930ba
commit a8579ffea0

View file

@ -1784,10 +1784,14 @@ pad_added_cb (GstElement * decodebin, GstPad * pad, GstSourceGroup * group)
switch (select->type) {
case GST_PLAY_SINK_TYPE_VIDEO:
case GST_PLAY_SINK_TYPE_VIDEO_RAW:
/* we want to return NOT_LINKED for unselected pads but only for audio
* and video pads because text pads might come from an external file. */
g_object_set (sinkpad, "always-ok", FALSE, NULL);
signal = SIGNAL_VIDEO_CHANGED;
break;
case GST_PLAY_SINK_TYPE_AUDIO:
case GST_PLAY_SINK_TYPE_AUDIO_RAW:
g_object_set (sinkpad, "always-ok", FALSE, NULL);
signal = SIGNAL_AUDIO_CHANGED;
break;
case GST_PLAY_SINK_TYPE_TEXT: