diff options
author | rim <rozhuk.im@gmail.com> | 2023-02-12 19:35:22 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-08-20 20:02:40 +0200 |
commit | f2453b60ee279790197d9c5783af16552afe1838 (patch) | |
tree | d677e415e4b30b7a2aaacc4f25ed564775ae11fc /audio/out/ao_oss.c | |
parent | bf1e1a796198e8e220a0bd1cd6a5f346f4f9b3fa (diff) | |
download | mpv-f2453b60ee279790197d9c5783af16552afe1838.tar.bz2 mpv-f2453b60ee279790197d9c5783af16552afe1838.tar.xz |
ao_oss: add "spdif" passthrough support for high bitrate codecs (e.g. Dolby Atmos, DTS-HD, etc.) over HDMI
In addition to the patch, appropriate additions to the mpv.conf file
will of course be needed for this to work. For example on my system:
audio-device=oss//dev/dsp4
audio-spdif=ac3,dts,dts-hd,eac3,truehd
This has been tested using recent FreeBSD-13.1-stable, using external
surround processors (both a Trinnov Altitude 16 and an LG OLED that
supports Dolby Atmos, and connected with HDMI to an NVidia RTX 2070).
Author and tester: David G Lawrence <dg1007@dglawrence.com>
Diffstat (limited to 'audio/out/ao_oss.c')
-rw-r--r-- | audio/out/ao_oss.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/audio/out/ao_oss.c b/audio/out/ao_oss.c index 8d7dd63871..5c0b8c97aa 100644 --- a/audio/out/ao_oss.c +++ b/audio/out/ao_oss.c @@ -186,11 +186,11 @@ static int init(struct ao *ao) /* Channels count. */ if (af_fmt_is_spdif(format)) { - /* Probably could be fixed by setting number of channels; - * needs testing. */ - if (channels.num != 2) { - MP_ERR(ao, "Format %s not implemented.\n", af_fmt_to_str(format)); - goto err_out; + nchannels = reqchannels = channels.num; + if (ioctl(p->dsp_fd, SNDCTL_DSP_CHANNELS, &nchannels) == -1) { + MP_ERR(ao, "Failed to set audio device to %d channels.\n", + reqchannels); + goto err_out_ioctl; } } else { struct mp_chmap_sel sel = {0}; |