ao_audiotrack: fix missing check for passthrough support

This commit is contained in:
sfan5 2024-02-25 15:16:44 +01:00
parent 86fa9b18a3
commit 3c1c848c2b
1 changed files with 4 additions and 0 deletions

View File

@ -658,6 +658,10 @@ static int init(struct ao *ao)
if (af_fmt_is_spdif(ao->format)) {
p->format = AudioFormat.ENCODING_IEC61937;
if (!p->format || !AudioTrack.writeShortV23) {
MP_ERR(ao, "spdif passthrough not supported by API\n");
return -1;
}
} else if (ao->format == AF_FORMAT_U8) {
p->format = AudioFormat.ENCODING_PCM_8BIT;
} else if (p->cfg_pcm_float && af_fmt_is_float(ao->format)) {