Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug: always synchronize SegmentInventory before reporting it through the API #1317

Merged
merged 1 commit into from Nov 21, 2023

Conversation

peaBerberian
Copy link
Collaborator

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.

…h the API

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.
@peaBerberian peaBerberian added this to the 3.33.0 milestone Nov 20, 2023
@peaBerberian peaBerberian merged commit 0c1130e into master Nov 21, 2023
3 checks passed
@peaBerberian peaBerberian mentioned this pull request Jan 24, 2024
@peaBerberian peaBerberian deleted the fix/buffer-signaling branch February 7, 2024 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants