Long playback stall after failed to get next segment reference
See original GitHub issueHave you read the FAQ and checked for duplicate open issues? Yes
What version of Shaka Player are you using? 3.0.6
Can you reproduce the issue with our latest release version? Yes
Can you reproduce the issue with the latest code from master
?
Yes
Are you using the demo app or your own custom app? Demo app
If custom app, can you reproduce the issue using our demo app? N/A
What browser and OS are you using? Chrome 87.0.4280.88, Windows 10
For embedded devices (smart TVs, etc.), what model and firmware version are you using? N/A
What are the manifest and license server URIs?
N/A
What did you do?
Start playback
What did you expect to happen? Playback smoothly
What actually happened?
Sometimes when streaming_engine failed to get next segment reference, streaming_engine would fail to advance to next segment forever unless there was an interruption (eg. bitrate change)
The following is the log when this issue happed:
simple_abr_manager.js:279 Calling switch_(), bandwidth=4845 kbps
player.js:4829 switch_
streaming_engine.js:431 switch: switching to Stream (video:4)
streaming_engine.js:414 switch: Stream (audio:10) already active
streaming_engine.js:1104 (video:4) cannot find segment endTime: 49700.617633999995
dash_parser.js:1040 Updating manifest...
(Updating manifest... continues forever)
The error is located at getSegmentReferenceNeeded_
of streaming_engine
When mediaState.lastSegmentReference
exists and mediaState.segmentIterator
is null, a new segmentIterator will be created by segmentIndex.getIteratorForTime
:
https://github.com/google/shaka-player/blob/master/lib/media/streaming_engine.js#L1100
In getIteratorForTime
of segment_index
, no index could be found unfortunately
A new SegmentIterator
is created with index = -1
After that, the query of next segment iterator (https://github.com/google/shaka-player/blob/master/lib/media/streaming_engine.js#L1101)
makes currentPosition_
of SegmentIterator
increment from -1 to 0 (https://github.com/google/shaka-player/blob/master/lib/media/segment_index.js#L517)
A null segment reference is returned from mediaState.segmentIterator.next().value
and a warning is fired:
https://github.com/google/shaka-player/blob/master/lib/media/streaming_engine.js#L1103
In the next update, getSegmentReferenceNeeded_
is called again
This time mediaState.segmentIterator
is no longer null and mediaState.segmentIterator.current()
is returned. (which is null)
getSegmentReferenceNeeded_
will then always return null segment reference, unless mediaState.segmentIterator
is set to null and segmentIndex.getIteratorForTime
is called again
To workaround, we have inserted mediaState.segmentIterator = null
after line:
https://github.com/google/shaka-player/blob/master/lib/media/streaming_engine.js#L1103
https://github.com/google/shaka-player/blob/master/lib/media/streaming_engine.js#L1135
but not sure if it is the proper fix
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
Tried v3.0.7 and latest master branch (v3.1.0-pre), long playback stall is still reproducible. I have sent the manifest URI to shaka-player-issues@google.com.
I believe that we’ve run into this issue as well. It’s reproducable for us in
v3.0.6
,v3.0.10
andv3.1.0
.We’re able to reproduce it by jumping a small gap when close to live, or by swaping bitrates while playing the stream live, simularly as described in https://github.com/google/shaka-player/issues/3082#issuecomment-781964165
Can this issue be reopened? @TheModMaker
Edit: This seems to only happen in a live stream and being close to the the live edge. The closer you are to the live edge, the easier it is to reproduce