GNOME Bugzilla – Bug 756804
playsink: text_sink dynamic reconnection is not working
Last modified: 2015-10-20 07:37:31 UTC
I am playing a HLS stream with subtitles. However, on bitrate change, playback hangs. I dumped the .dot file (see attached), and saw that text_sink pad of playsink was not connected. Inside gstplaysink.c, following code is there: if (!playsink->text_sinkpad_stream_synchronizer) { GValue item = { 0, }; playsink->text_sinkpad_stream_synchronizer = gst_element_get_request_pad (GST_ELEMENT_CAST (playsink->stream_synchronizer), "sink_%u"); it = gst_pad_iterate_internal_links (playsink->text_sinkpad_stream_synchronizer); g_assert (it); gst_iterator_next (it, &item); playsink->text_srcpad_stream_synchronizer = g_value_dup_object (&item); g_value_unset (&item); g_assert (playsink->text_srcpad_stream_synchronizer); gst_iterator_free (it); gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (playsink->text_pad), playsink->text_sinkpad_stream_synchronizer); gst_pad_link_full (playsink->text_srcpad_stream_synchronizer, playsink->textchain->textsinkpad, GST_PAD_LINK_CHECK_NOTHING); } Now, in case of dynamic pipeline switching playsink->text_sinkpad_stream_synchronizer will not be NULL but still below two lines need to be executed for its reconnection (as is done for audio/video pads): gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (playsink->text_pad), playsink->text_sinkpad_stream_synchronizer); gst_pad_link_full (playsink->text_srcpad_stream_synchronizer, playsink->textchain->textsinkpad, GST_PAD_LINK_CHECK_NOTHING);
Created attachment 313648 [details] Dot file dump at time of bitrate change
Created attachment 313650 [details] [review] proposed patch for re-linking text pad dynamically
Patch looks fine, can you share the stream or point us to a public one so we can reproduce the issue? And likely include it in our validate test runs?
Sorry but I can't share the stream. In my ts demux plugin, I created a subtitle pad forcefully, only then I observed this issue. For public stream, you can refer to https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8 (which has support for subtitles) But if I play this stream in native environment, tsdemux does not exposes a subtitle pad and hence this issue does not comes. If you like to reproduce this issue, you may need to forcefully expose a subtitle pad in tsdemux.
commit 68ec631db73c52d9006ac46ecd1437fc2e0adc34 Author: Rajat Verma <rajat.verma@st.com> Date: Mon Oct 19 15:32:19 2015 +0530 playsink: relink text_pad in case of reconfiguration In case of reconfiguration, text_pad should be re-connected with stream synchronizer sink pad. Otherwise we'll leave an unlinked pad around if there always was a streamsynchronizer text pad. https://bugzilla.gnome.org/show_bug.cgi?id=756804