After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 756804 - playsink: text_sink dynamic reconnection is not working
playsink: text_sink dynamic reconnection is not working
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal major
: 1.7.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-19 09:54 UTC by Rajat Verma
Modified: 2015-10-20 07:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Dot file dump at time of bitrate change (43.43 KB, application/msword)
2015-10-19 09:55 UTC, Rajat Verma
  Details
proposed patch for re-linking text pad dynamically (1.47 KB, patch)
2015-10-19 10:05 UTC, Rajat Verma
committed Details | Review

Description Rajat Verma 2015-10-19 09:54:29 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);
Comment 1 Rajat Verma 2015-10-19 09:55:57 UTC
Created attachment 313648 [details]
Dot file dump at time of bitrate change
Comment 2 Rajat Verma 2015-10-19 10:05:05 UTC
Created attachment 313650 [details] [review]
proposed patch for re-linking text pad dynamically
Comment 3 Thiago Sousa Santos 2015-10-19 16:37:50 UTC
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?
Comment 4 Rajat Verma 2015-10-20 03:52:15 UTC
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.
Comment 5 Sebastian Dröge (slomo) 2015-10-20 07:37:31 UTC
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