playbin2: Avoid resetting playsink when not needed

When we don't have specific {audio|video|text}-sink properties, don't
set them on playsink when reconfiguring.
If we do that, we end up setting the previous configured sink to
GST_STATE_NULL resulting in any potentially pending push being returned
with GST_FLOW_WRONG_STATE which will cause the upstream elements to
silently stop.

https://bugzilla.gnome.org/show_bug.cgi?id=655279
This commit is contained in:
Edward Hervey 2011-07-25 18:37:15 +02:00
parent 2db389f775
commit 059db89633

View file

@ -2787,20 +2787,26 @@ no_more_pads_cb (GstElement * decodebin, GstSourceGroup * group)
/* if we have custom sinks, configure them now */ /* if we have custom sinks, configure them now */
GST_SOURCE_GROUP_LOCK (group); GST_SOURCE_GROUP_LOCK (group);
GST_INFO_OBJECT (playbin, "setting custom audio sink %" GST_PTR_FORMAT, if (group->audio_sink) {
group->audio_sink); GST_INFO_OBJECT (playbin, "setting custom audio sink %" GST_PTR_FORMAT,
gst_play_sink_set_sink (playbin->playsink, GST_PLAY_SINK_TYPE_AUDIO, group->audio_sink);
group->audio_sink); gst_play_sink_set_sink (playbin->playsink, GST_PLAY_SINK_TYPE_AUDIO,
group->audio_sink);
}
GST_INFO_OBJECT (playbin, "setting custom video sink %" GST_PTR_FORMAT, if (group->video_sink) {
group->video_sink); GST_INFO_OBJECT (playbin, "setting custom video sink %" GST_PTR_FORMAT,
gst_play_sink_set_sink (playbin->playsink, GST_PLAY_SINK_TYPE_VIDEO, group->video_sink);
group->video_sink); gst_play_sink_set_sink (playbin->playsink, GST_PLAY_SINK_TYPE_VIDEO,
group->video_sink);
}
GST_INFO_OBJECT (playbin, "setting custom text sink %" GST_PTR_FORMAT, if (playbin->text_sink) {
playbin->text_sink); GST_INFO_OBJECT (playbin, "setting custom text sink %" GST_PTR_FORMAT,
gst_play_sink_set_sink (playbin->playsink, GST_PLAY_SINK_TYPE_TEXT, playbin->text_sink);
playbin->text_sink); gst_play_sink_set_sink (playbin->playsink, GST_PLAY_SINK_TYPE_TEXT,
playbin->text_sink);
}
GST_SOURCE_GROUP_UNLOCK (group); GST_SOURCE_GROUP_UNLOCK (group);