From 68f1057d2ef3c24bf2d0dcd37d877e21e2879a65 Mon Sep 17 00:00:00 2001 From: Alex Mitzsch <43502191+mitzsch@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:23:42 +0100 Subject: [PATCH] ad_spdif: fix DTS 44.1khz passthrough playback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix DTS passthrough playback of 44.1 khz content. Also, take into account that there are some DTS variants with a samplerate of 96khz (e.g. DTS 24/96), somehow they are recognized wrongly as 48khz by the code. DonĀ“t rely on this "bug", do it correctly. Now every samplerate above 44.1Khz is correctly treated as 48khz, and 44.1khz files are treated as 44.1khz for bitstreaming. --- audio/decode/ad_spdif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/decode/ad_spdif.c b/audio/decode/ad_spdif.c index 393af8a2a3..bb110cbed4 100644 --- a/audio/decode/ad_spdif.c +++ b/audio/decode/ad_spdif.c @@ -226,7 +226,7 @@ static int init_filter(struct mp_filter *da) num_channels = dts_hd_spdif_channel_count; } else { sample_format = AF_FORMAT_S_DTS; - samplerate = 48000; + samplerate = c_rate > 44100 ? 48000 : 44100; num_channels = 2; } break;