add config option for audio device name and set it on startup

This commit is contained in:
Drew Weymouth
2023-04-05 18:19:56 -07:00
parent b5086eafd3
commit d6a84c78a1
3 changed files with 10 additions and 0 deletions
+4
View File
@@ -406,6 +406,10 @@ func (p *Player) ListAudioDevices() ([]AudioDevice, error) {
return devices, nil
}
func (p *Player) SetAudioDevice(deviceName string) error {
return p.mpv.SetPropertyString("audio-device", deviceName)
}
func (p *Player) getInt64Property(propName string) (int64, error) {
playpos, err := p.mpv.GetProperty(propName, mpv.FORMAT_INT64)
if err != nil {