-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Refine multi-track support + track selection #1121
Comments
Track selection is pretty complicated. The current approach we take has quite a lot of niggles:
We do have plans to fix all of this, although it's quite a lot of work. I'm envisaging something like:
|
|
I've raised this before, but basically our application ends up having to have a compatibility matrix representing what the current version of ExoPlayer it's using actually supports (e.g. what codecs the extractors can handle). This is to allow translation of the original source files track indexes into ExoPlayer's. It makes it very important that in our application we ensure we update that matrix whenever we update ExoPlayer, otherwise we'll end up with incorrect track selections. What you're suggesting sounds great, and would remove a lot of this complexity.
That sounds exactly what we need :) Is there any existing GHI that covers that work that I can follow? Or would it be okay to change this GHI for that change, or even create a new one? |
This gives DefaultSmoothStreamingTrackSelector feature parity with DefaultDashTrackSelector. Note that the code duplication across these classes will go away eventually, when we rework track selection as described in Github Issue #1121. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=111688784
This is fixed in the 2.x.x experimental branch. You can implement a custom TrackSelector to perform arbitrary selection of tracks for each renderer. Note that for nearly all use cases, using DefaultTrackSelector and just implementing a custom TrackSelectionPolicy should be sufficient. |
At the moment, our application will start playing a video (e.g. an MKV via the WebmExtractor) and wait until the
onPlayerStateChanged
callback is invoked with aplaybackState
ofExoPlayer.STATE_READY
. This event appeared to be the correct time when the extractor had parsed the media file, and therefore knew which tracks were available. It was also before playback had begun, so didn't introduce any user visible issues where the wrong track would temporarily be played.This works well, except for the scenario when the first track (which is the default one selected) is not actually supported but the application is actually wanting to select a different one. The specific scenario is as follows:
At the moment, what actually happens is that the player detects that DTS-HD isn't supported and calls the
onPlayerError
before theonPlayerStateChanged
.My question is when should be trying to select tracks:
onPlayerError
was called before we have selected the track and see if we can select it and try again?Thanks in advance!
The text was updated successfully, but these errors were encountered: