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

Fix: Resolved issue for switching audio tracks #2075

Closed
wants to merge 1 commit into from

Conversation

F0x1
Copy link

@F0x1 F0x1 commented Dec 14, 2024

Fix: Prevent Video Playback Issues on Roku When Switching Audio Tracks

Changes

Added logic to stop the LoadMetaDataTask before reusing it to prevent potential conflicts that could cause playback issues.
Improved comments to clarify the configuration and execution flow of the metadata task.
Context
This fixes a bug encountered on Roku devices where switching audio tracks during playback caused the video to stop functioning. The issue was due to conflicts arising from the reuse of the LoadMetaDataTask without proper stopping and resetting.

Issues

Fixes #2059

Notes for Reviewers

  • I would originally get "Error During Playback" when attempting to switch audio tracks before the bug fix

- Added logic to stop `LoadMetaDataTask` before reusing it to prevent potential conflicts.
- Improved comments for clarity on metadata task configuration and execution.
@F0x1 F0x1 requested a review from a team as a code owner December 14, 2024 23:27
@jimdogx
Copy link
Contributor

jimdogx commented Dec 15, 2024

@F0x1 Thanks for looking in to this. Reviewing the code though, I think I see the issue. Any chance you can test your setup with the original code (without your changes) and only change one line:

comment out (or remove) this line in onAudioIndexChange():

m.LoadMetaDataTask.selectedSubtitleIndex = m.top.SelectedSubtitle

(it's line 349 in the original code for me)

@F0x1
Copy link
Author

F0x1 commented Dec 15, 2024

@jimdogx it looks like that fixes it as well not sure why though

@jimdogx
Copy link
Contributor

jimdogx commented Dec 15, 2024

@jimdogx it looks like that fixes it as well not sure why though

I unfortunately don't have this issue with my setup. However, after I saw how you fixed it, I realized it's most likely because of a race condition. Removing that line is probably the correct fix.

I would also remove the following line from onSubtitleChange() also:

m.LoadMetaDataTask.selectedAudioStreamIndex = m.top.audioIndex

If you update your PR to just removing those two lines I can approve it 👍

Oh, also, can you base your change off of 2.2.z instead of Master. This is a bug fix, so it should go in the 2.2.z branch for the next release. 🎉

@F0x1 F0x1 closed this Dec 15, 2024
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.

Can't switch audio tracks
2 participants