Fixes for buffer and recent regressions #1323
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes found from slack discussion
One of the problems of high memory occupation
is due to
https://github.com/xbmc/inputstream.adaptive/blob/21.1.2-Omega/src/common/AdaptiveStream.cpp#L617-L638
where we set:
assured_buffer_length_ to 60
max_buffer_length_ to 120
in the old code:
https://github.com/xbmc/inputstream.adaptive/blob/Nexus/src/common/AdaptiveStream.cpp#L541-L550
instead set:
assured_buffer_length_ to 4
max_buffer_length_ to 8
this implies we have a very big buffer that require much memory so increase a lot until the end
i think it is better to completely disable this bad code that we have been dragging around for years
now we have almost stable memory occuped,
but we can see about 100 mb increased on start(seem regular its debug vs release build)there is a little memory that increase of about 1mb each time after some seconds that could require other investigations but could be a problem at kodi side (its present also on old isa version)
this bug also reveals another problem on buffering
when we put the playback on pause, we continue download segments where should be paused and resumed when playback will be resumed, this can be improved later, until now this problem was hidden because the buffer is short
Commit: Fallback to ADTS sample reader when TS initialization fails
fix the audio with youtube HLS manifests
where we have wrong container, use file extension is not reliable,
tested with HLS version of https://www.youtube.com/watch?v=Hf5enZVznC4
Motivation and context
fix #1295
How has this been tested?
Screenshots (if appropriate):
Types of change
Checklist: