summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-11-07 21:38:10 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-11-12 13:20:41 +0100
commitb02d9837f7c92ddd3a5b884885719208a4c0a09e (patch)
treec0937a68d3ef9f048e38451ab346d6604b493881
parentaf3d16dbb1751c6e04a1de89328c65095c8a025b (diff)
playbin2/playsink: Use new "silent" property instead of unlinking
This makes sure that subtitleoverlay still gets segment updates and everything to pass on downstream. Without this segment problems happen.
-rw-r--r--gst/playback/gstplaybin2.c16
-rw-r--r--gst/playback/gstplaysink.c20
2 files changed, 5 insertions, 31 deletions
diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c
index 273aacfc5..a3fbdc244 100644
--- a/gst/playback/gstplaybin2.c
+++ b/gst/playback/gstplaybin2.c
@@ -1238,24 +1238,8 @@ gst_play_bin_set_suburi (GstPlayBin * playbin, const gchar * suburi)
static void
gst_play_bin_set_flags (GstPlayBin * playbin, GstPlayFlags flags)
{
- GstPlayFlags oldflags = gst_play_sink_get_flags (playbin->playsink);
- GstSourceGroup *group = playbin->curr_group;
- gboolean unblock = FALSE;
-
- if (group && group->suburidecodebin) {
- if ((oldflags & GST_PLAY_FLAG_TEXT) && !(flags & GST_PLAY_FLAG_TEXT)) {
- gst_play_bin_suburidecodebin_block (group->suburidecodebin, TRUE);
- } else if (!(oldflags & GST_PLAY_FLAG_TEXT) && (flags & GST_PLAY_FLAG_TEXT)) {
- gst_play_bin_suburidecodebin_seek_to_start (group->suburidecodebin);
- unblock = TRUE;
- }
- }
-
gst_play_sink_set_flags (playbin->playsink, flags);
gst_play_sink_reconfigure (playbin->playsink);
-
- if (unblock)
- gst_play_bin_suburidecodebin_block (group->suburidecodebin, FALSE);
}
static GstPlayFlags
diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c
index 7993bc317..a6afa2ed1 100644
--- a/gst/playback/gstplaysink.c
+++ b/gst/playback/gstplaysink.c
@@ -98,7 +98,6 @@ typedef struct
GstElement *overlay;
GstPad *videosinkpad;
GstPad *textsinkpad;
- GstPad *textsinkpad_target;
GstPad *srcpad; /* outgoing srcpad, used to connect to the next
* chain */
GstElement *sink; /* custom sink to receive subtitle buffers */
@@ -1189,6 +1188,7 @@ gen_text_chain (GstPlaySink * playsink)
} else {
gst_bin_add (bin, chain->overlay);
+ g_object_set (G_OBJECT (chain->overlay), "silent", FALSE, NULL);
if (playsink->font_desc) {
g_object_set (G_OBJECT (chain->overlay), "font-desc",
playsink->font_desc, NULL);
@@ -1224,7 +1224,6 @@ gen_text_chain (GstPlaySink * playsink)
}
if (textsinkpad) {
chain->textsinkpad = gst_ghost_pad_new ("text_sink", textsinkpad);
- chain->textsinkpad_target = textsinkpad;
gst_object_unref (textsinkpad);
gst_element_add_pad (chain->chain.bin, chain->textsinkpad);
}
@@ -1825,20 +1824,11 @@ gst_play_sink_reconfigure (GstPlaySink * playsink)
playsink->textchain = gen_text_chain (playsink);
}
if (playsink->textchain) {
- GstPad *target;
-
GST_DEBUG_OBJECT (playsink, "adding text chain");
+ g_object_set (G_OBJECT (playsink->textchain->overlay), "silent", FALSE,
+ NULL);
add_chain (GST_PLAY_CHAIN (playsink->textchain), TRUE);
- if (!(target =
- gst_ghost_pad_get_target (GST_GHOST_PAD_CAST
- (playsink->textchain->textsinkpad)))) {
- target = gst_object_ref (playsink->textchain->textsinkpad_target);
- gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (playsink->
- textchain->textsinkpad), target);
- }
- gst_object_unref (target);
-
gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (playsink->text_pad),
playsink->textchain->textsinkpad);
gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (playsink->video_pad),
@@ -1859,8 +1849,8 @@ gst_play_sink_reconfigure (GstPlaySink * playsink)
} else {
/* we have a chain and a textpad, turn the subtitles off */
GST_DEBUG_OBJECT (playsink, "turning off the text");
- gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (playsink->
- textchain->textsinkpad), NULL);
+ g_object_set (G_OBJECT (playsink->textchain->overlay), "silent", TRUE,
+ NULL);
}
}
if (!need_video && playsink->video_pad)