If the output rate is different to the input rate, look for the deepest output bit depth, to give the transcoder the chance to minimise transcoding inaccuracies.

This commit is contained in:
Mike Brady
2026-08-20 15:47:37 +01:00
parent c4e17b60ef
commit 6966a74c82
+4 -4
View File
@@ -994,7 +994,7 @@ int32_t search_for_suitable_configuration(unsigned int channels, unsigned int ra
}
#ifdef CONFIG_FFMPEG
if (local_format == SPS_FORMAT_UNKNOWN) {
debug(3, "check for the next highest rate above %u with %u channels.", rate,
debug(3, "check for the next highest rate above %u with %u channels and the best format.", rate,
local_channels);
unsigned int rate_pointer = 0;
while ((rate_pointer < sizeof(rates) / sizeof(unsigned int)) &&
@@ -1002,7 +1002,7 @@ int32_t search_for_suitable_configuration(unsigned int channels, unsigned int ra
local_rate = rates[rate_pointer];
if (local_rate > rate) {
local_format = check_configuration_with_formats(
local_channels, local_rate, (sps_format_t)format, check_configuration);
local_channels, local_rate, SPS_FORMAT_S32, check_configuration);
}
if (local_format == SPS_FORMAT_UNKNOWN) {
rate_pointer++;
@@ -1012,13 +1012,13 @@ int32_t search_for_suitable_configuration(unsigned int channels, unsigned int ra
if (local_format == SPS_FORMAT_UNKNOWN) {
int rate_pointer = (int)(sizeof(rates) / sizeof(unsigned int) - 1);
debug(3, "check for the next lowest rate below %u with %u channels.", rate,
debug(3, "check for the next lowest rate below %u with %u channels and the best format.", rate,
local_channels);
while ((rate_pointer >= 0) && (local_format == SPS_FORMAT_UNKNOWN)) {
local_rate = rates[rate_pointer];
if (local_rate < rate) {
local_format = check_configuration_with_formats(
local_channels, local_rate, (sps_format_t)format, check_configuration);
local_channels, local_rate, SPS_FORMAT_S32, check_configuration);
}
if (local_format == SPS_FORMAT_UNKNOWN) {
rate_pointer--;