summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-02-16 15:32:47 +0100
committerSebastian Dröge <sebastian@centricular.com>2014-02-17 08:41:16 +0100
commite5f482e4a2a57b7d9e6996aaefc71f01b12e359c (patch)
treeefcdea7dc1f0479c899baa09b196fff7a8a1acae
parente4949fbd6db22ab0737e7e701fe98d944fbbfcbf (diff)
downloadgstreamer-plugins-base-e5f482e4a2a57b7d9e6996aaefc71f01b12e359c.tar.gz
playsink: Only remove the complete text chain if the text pad goes away
If the text pads does not go away we just set the overlay to silent, which allows us to immediately re-enable subs later again. However before this change we also released the streamsynchronizer text pads, which deadlocked because there was still dataflow going on. Just do this only if we remove the complete chain. https://bugzilla.gnome.org/show_bug.cgi?id=683504
-rw-r--r--gst/playback/gstplaysink.c61
1 files changed, 32 insertions, 29 deletions
diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c
index 18e1b5689..2dc13a2dd 100644
--- a/gst/playback/gstplaysink.c
+++ b/gst/playback/gstplaysink.c
@@ -3476,22 +3476,44 @@ gst_play_sink_do_reconfigure (GstPlaySink * playsink)
GST_DEBUG_OBJECT (playsink, "no text needed");
/* we have no subtitles/text or we are requested to not show them */
- if (playsink->text_sinkpad_stream_synchronizer) {
- gst_element_release_request_pad (GST_ELEMENT_CAST
- (playsink->stream_synchronizer),
- playsink->text_sinkpad_stream_synchronizer);
- gst_object_unref (playsink->text_sinkpad_stream_synchronizer);
- playsink->text_sinkpad_stream_synchronizer = NULL;
- gst_object_unref (playsink->text_srcpad_stream_synchronizer);
- playsink->text_srcpad_stream_synchronizer = NULL;
- }
-
if (playsink->textchain) {
if (playsink->text_pad == NULL) {
/* no text pad, remove the chain entirely */
GST_DEBUG_OBJECT (playsink, "removing text chain");
add_chain (GST_PLAY_CHAIN (playsink->textchain), FALSE);
activate_chain (GST_PLAY_CHAIN (playsink->textchain), FALSE);
+
+ if (playsink->text_sinkpad_stream_synchronizer) {
+ gst_element_release_request_pad (GST_ELEMENT_CAST
+ (playsink->stream_synchronizer),
+ playsink->text_sinkpad_stream_synchronizer);
+ gst_object_unref (playsink->text_sinkpad_stream_synchronizer);
+ playsink->text_sinkpad_stream_synchronizer = NULL;
+ gst_object_unref (playsink->text_srcpad_stream_synchronizer);
+ playsink->text_srcpad_stream_synchronizer = NULL;
+ }
+
+ if (!need_video && playsink->video_pad) {
+ if (playsink->video_sinkpad_stream_synchronizer) {
+ gst_element_release_request_pad (GST_ELEMENT_CAST
+ (playsink->stream_synchronizer),
+ playsink->video_sinkpad_stream_synchronizer);
+ gst_object_unref (playsink->video_sinkpad_stream_synchronizer);
+ playsink->video_sinkpad_stream_synchronizer = NULL;
+ gst_object_unref (playsink->video_srcpad_stream_synchronizer);
+ playsink->video_srcpad_stream_synchronizer = NULL;
+ }
+
+ gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (playsink->video_pad),
+ NULL);
+ }
+
+ if (playsink->text_pad && !playsink->textchain)
+ gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (playsink->text_pad),
+ NULL);
+
+ if (playsink->text_sink)
+ gst_element_set_state (playsink->text_sink, GST_STATE_NULL);
} else {
/* we have a chain and a textpad, turn the subtitles off */
GST_DEBUG_OBJECT (playsink, "turning off the text");
@@ -3500,25 +3522,6 @@ gst_play_sink_do_reconfigure (GstPlaySink * playsink)
NULL);
}
}
- if (!need_video && playsink->video_pad) {
- if (playsink->video_sinkpad_stream_synchronizer) {
- gst_element_release_request_pad (GST_ELEMENT_CAST
- (playsink->stream_synchronizer),
- playsink->video_sinkpad_stream_synchronizer);
- gst_object_unref (playsink->video_sinkpad_stream_synchronizer);
- playsink->video_sinkpad_stream_synchronizer = NULL;
- gst_object_unref (playsink->video_srcpad_stream_synchronizer);
- playsink->video_srcpad_stream_synchronizer = NULL;
- }
-
- gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (playsink->video_pad), NULL);
- }
-
- if (playsink->text_pad && !playsink->textchain)
- gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (playsink->text_pad), NULL);
-
- if (playsink->text_sink)
- gst_element_set_state (playsink->text_sink, GST_STATE_NULL);
}
update_av_offset (playsink);
do_async_done (playsink);