From: Sebastian Dröge Date: Fri, 23 Apr 2010 14:08:14 +0000 (+0200) Subject: playbin2: If a text sink is provided, let subtitle parsing be done by decodebin2... X-Git-Tag: RELEASE-0.10.30~266 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc8a5bdcd322efcdc7814483e71d0349e81f24a0;p=platform%2Fupstream%2Fgst-plugins-base.git playbin2: If a text sink is provided, let subtitle parsing be done by decodebin2 if required This way subtitle sinks only get buffers in the format that they understand, i.e. raw parsed text in most cases. Fixes bug #614942. --- diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index 440bb5f..3b34fcb 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -2972,8 +2972,25 @@ autoplug_continue_cb (GstElement * element, GstPad * pad, GstCaps * caps, { GstCaps *subcaps; gboolean ret = FALSE; + GstElement *text_sink; + GstPad *text_sinkpad = NULL; + + text_sink = + (group->playbin->text_sink) ? gst_object_ref (group-> + playbin->text_sink) : NULL; + if (text_sink) + text_sinkpad = gst_element_get_static_pad (text_sink, "sink"); + + if (text_sinkpad) { + subcaps = gst_pad_get_caps_reffed (text_sinkpad); + gst_object_unref (text_sinkpad); + } else { + subcaps = gst_subtitle_overlay_create_factory_caps (); + } + + if (text_sink) + gst_object_unref (text_sink); - subcaps = gst_subtitle_overlay_create_factory_caps (); ret = !gst_caps_can_intersect (subcaps, caps); gst_caps_unref (subcaps);