Debug: always synchronize SegmentInventory before reporting it through the API #1317
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.
We have a minor issue with an undocumented API letting applications know the content of the various buffers (audio, video and text), which may show in some rare cases to an unsynchronized view into one of those buffers.
As this API is not documented and put behind an unwelcoming method name, the only impact that unsynchronized status could have are:
information shown in the RxPlayer's debug element (through the
createDebugElement API
) could not reflect the exact reality.The only case I've seen now is that when enabling then disabling text tracks, we may still see a view making it seems that the since-remove text segments pushed were still here (it is in reality not, as should be expected).
Likewise, our demo page's buffer graph, which rely on the same API, could show an unsynchronized view into the buffer in the same situation.
The solution I found was just to make sure the
SegmentInventory
, the module actually storing that buffer information, is always synchronized to the buffer at the time that hidden API is called. This could mean unnecessary calls when the buffer is already synchronized, but we do not care much as that API is only called for debug anyway and not even performance-sensitive for the moment.