Merge pull request #1107 from skoruppa/fixes-2
fix infinite buffering after audio track switch
This commit is contained in:
commit
a3802e2abb
1 changed files with 4 additions and 0 deletions
|
|
@ -55,6 +55,10 @@ internal fun PlayerRuntimeController.selectAudioTrack(trackIndex: Int) {
|
|||
.buildUpon()
|
||||
.setOverrideForType(override)
|
||||
.build()
|
||||
// Nudge the player to avoid infinite buffering after audio track switch
|
||||
// where the new track requires a different segment.
|
||||
val pos = player.currentPosition
|
||||
if (pos > 0) player.seekTo((pos - 1).coerceAtLeast(0))
|
||||
return
|
||||
}
|
||||
currentAudioIndex++
|
||||
|
|
|
|||
Loading…
Reference in a new issue