From 059db89633151248f1612edb64de0c9d6208e4b1 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 25 Jul 2011 18:37:15 +0200 Subject: [PATCH] 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 --- gst/playback/gstplaybin2.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index 93f409bff3..d788ebec19 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -2787,20 +2787,26 @@ no_more_pads_cb (GstElement * decodebin, GstSourceGroup * group) /* if we have custom sinks, configure them now */ GST_SOURCE_GROUP_LOCK (group); - GST_INFO_OBJECT (playbin, "setting custom audio sink %" GST_PTR_FORMAT, - group->audio_sink); - gst_play_sink_set_sink (playbin->playsink, GST_PLAY_SINK_TYPE_AUDIO, - group->audio_sink); + if (group->audio_sink) { + GST_INFO_OBJECT (playbin, "setting custom audio sink %" GST_PTR_FORMAT, + 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, - group->video_sink); - gst_play_sink_set_sink (playbin->playsink, GST_PLAY_SINK_TYPE_VIDEO, - group->video_sink); + if (group->video_sink) { + GST_INFO_OBJECT (playbin, "setting custom video sink %" GST_PTR_FORMAT, + 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, - playbin->text_sink); - gst_play_sink_set_sink (playbin->playsink, GST_PLAY_SINK_TYPE_TEXT, - playbin->text_sink); + if (playbin->text_sink) { + GST_INFO_OBJECT (playbin, "setting custom text sink %" GST_PTR_FORMAT, + playbin->text_sink); + gst_play_sink_set_sink (playbin->playsink, GST_PLAY_SINK_TYPE_TEXT, + playbin->text_sink); + } GST_SOURCE_GROUP_UNLOCK (group);