don't unpause when switching players while paused
This commit is contained in:
@@ -142,16 +142,20 @@ func (p *playbackEngine) SetPlayer(pl player.BasePlayer) {
|
|||||||
needToUnpause := false
|
needToUnpause := false
|
||||||
|
|
||||||
stat := p.PlayerStatus()
|
stat := p.PlayerStatus()
|
||||||
|
if p.pendingPlayerChange {
|
||||||
|
stat.State = player.Paused
|
||||||
|
}
|
||||||
|
|
||||||
switch stat.State {
|
switch stat.State {
|
||||||
case player.Stopped:
|
case player.Stopped:
|
||||||
// nothing
|
// nothing
|
||||||
case player.Playing:
|
case player.Playing:
|
||||||
p.Pause()
|
p.Pause()
|
||||||
|
needToUnpause = true
|
||||||
fallthrough
|
fallthrough
|
||||||
case player.Paused:
|
case player.Paused:
|
||||||
p.pendingPlayerChangeTimePos = stat.TimePos
|
p.pendingPlayerChangeTimePos = stat.TimePos
|
||||||
p.pendingPlayerChange = true
|
p.pendingPlayerChange = true
|
||||||
needToUnpause = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
oldVol := p.player.GetVolume()
|
oldVol := p.player.GetVolume()
|
||||||
|
|||||||
Reference in New Issue
Block a user