setAudioSpdif method

Future<void> setAudioSpdif(
  1. Set<Spdif> codecs
)
inherited

Sets HDMI and S/PDIF audio passthrough codecs.

Pass a Set of Spdif values to enable passthrough for those codecs (e.g. {Spdif.ac3, Spdif.dts}); pass {} to disable passthrough entirely. Order does not matter.

While a track passes through, the receiver decodes it and mpv cannot touch the audio: the effects chain, the soft volume and mute, ReplayGain, the volume gain, pitch, and the output rate, format and channels do not apply, a speed other than 1 drops or repeats parts of the stream instead of stretching it, and PlayerStream.fft, PlayerStream.pcm, the taps and PlayerStream.loudnessMeter emit nothing. When the output refuses the format, mpv decodes the track instead. Changed during playback, the list reopens the decoder, with a short gap.

Implementation

Future<void> setAudioSpdif(Set<Spdif> codecs) async {
  await _gate();
  await _calls.prop('audio-spdif', Spdif.formatMpvList(codecs));
  _updateField(
    (s) => s.copyWith(audioSpdif: codecs),
    _reactives.audioSpdif,
    codecs,
  );
}