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 785525 - Variant bitrate switching can fail if a pad is un-linked
Variant bitrate switching can fail if a pad is un-linked
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.12.2
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-07-28 13:11 UTC by davecraig
Modified: 2018-11-03 14:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Potential patch (816 bytes, text/plain)
2017-07-28 13:11 UTC, davecraig
Details

Description davecraig 2017-07-28 13:11:51 UTC
Created attachment 356513 [details]
Potential patch

I've been testing against a local copy of http://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8

This is a variant playlist with a couple of alternate AUDIO tracks.

The behaviour is that the stream starts off playing at the lowest bitrate which gives us pads src_0 (video), src_1 (audio1) and src_2 (audio2). Immediately after the first fragments are downloaded the code realises it should play one of the higher bitrates and so gets ready to switch. In order to switch it has to wait for any fragment downloads on the original pads to complete. Once they complete, the code triggers a bitrate switch and creates a new set of pads and continues playing.

However, in our application, we don't attach to src_2 as we're only interested in the default audio pad. The code attempts to deal with this and describes the pad as un-linked. The bug is that between _src_chain and gst_adaptive_demux_stream_download_loop (inside gstadapativedemux.c) the code doesn't handle the un-linked case fully and it fails to call gst_adaptive_demux_has_next_period in the GST_FLOW_NOT_LINKED case. 
If src_2 finishes downloading first (or second), then this isn't an issue as the other pads complete the set of streams in gst_adaptive_demux_combine_flows. However, if src_2 is the last to finish downloading, the new pads aren't created and playback grinds to a halt.

I've attached a patch which simply duplicates similar code used in the GST_FLOW_EOS case above it. Although I believe it resolves this bug, I immediately hit another issue which I'll file a bug for if this patch does look sane.
Comment 1 davecraig 2017-09-20 11:01:11 UTC
The other issue I filed as bug 787878. With that fixed too, this patch appears to work well.
Comment 2 GStreamer system administrator 2018-11-03 14:11:34 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/590.