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

Subsequent `selectTracks() after prepare does not override position #11285

Closed

Conversation

stevemayhew
Copy link
Contributor

The MaskingMediaPeriod.onChildSourceInfoRefreshed() already has the position correct from the initial timeline update, since the preparePositionUs is 0 the second condition in the if:

    if (preparePositionOverrideUs != C.TIME_UNSET && positionUs == preparePositionUs) {
	...

is false, so the preparePositionUs is not reset. This causes it to be used incorrectly on subsequent selectTracks() calls where positionUs does match preparePositionUs

The fix simply resets the preparePositionOverrideUs unconditionally, as only the initial selectTracks() after the prepared transition should use the override

The MaskingMediaPeriod.onChildSourceInfoRefreshed() already has the position correct from
the initial timeline update, since the `preparePositionUs` is 0 the second condition in the
if:

```
    if (preparePositionOverrideUs != C.TIME_UNSET && positionUs == preparePositionUs) {
	...
```
is false, so the `preparePositionUs` is not reset.  This causes it to be used incorrectly
on subsequent `selectTracks()` calls where `positionUs` does match `preparePositionUs`

The fix simply resets the `preparePositionOverrideUs` unconditionally, as only the
initial `selectTracks()` after the prepared transition should use the override
@icbaker
Copy link
Collaborator

icbaker commented Sep 8, 2023

Hi Steve - can you please make this PR against the https://github.com/androidx/media project instead? Unfortunately we're unable to merge PRs in this deprecated project. After the change is merged in that project it will get pushed back to the dev-v2 branch here.

@icbaker icbaker closed this Sep 8, 2023
@google google locked and limited conversation to collaborators Nov 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants