Now in the beginning it plays from http://first.m3u8 links playlist0.ts as I
have set connection-speed of hlsdemux to be 0 (UNKNOWN).
hence when fetching next fragment it checks the available bitrate and
switches to say http://third.m3u8 playlist's playlist1.ts.
When it switches, I am removing all the elements after hlsdemux
(multiqueue0, tsdemux, audio-video multiqueue, input-selectors and
decodebin) apart from the audio-video sinks.
Then when I receive a new pad-added for hls after it switches, I re-create
the elements and I see that my pipeline has gone to play state.
The issue is it plays the playlist0.ts file properly, But whenever there is
a switch in playlist due to change in the bandwidth, I always get 20 second
delay and then my playback starts from 11th second (both audio-video).
After few analysis I found out that when it switches, my pipeline creation
and going to playing state is completed and audio-video multiqueues have
buffered from 11-25 seconds of data (15seconds is the max-size-time set on
After this I get the data to the next element (that is the decoders) after
20 seconds and playbacks starts.
Can someone suggest what to look into as the playback starts with 1-2 second
delay (which is OK), but whenever bandwidth switches, I always have the "20
second delay" and amazingly audio-video sinks play them without any drops
after 20 seconds.