summaryrefslogtreecommitdiffstats
path: root/libhb/common.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2020-07-01 14:33:17 -0700
committerJohn Stebbins <[email protected]>2020-07-01 15:05:39 -0700
commitd3ea0cbb24a5da4fac6ead6656aacf09c13e5479 (patch)
tree0516dfa409c21bc26f2c0423504daa2623aad47d /libhb/common.c
parentc3e2d6b5dd1071476de70443f0cf7e8a3b3aa373 (diff)
Only dither audio when necessary
If dither is "auto", only enable dither if source depth > dest depth Lossy codecs do not have a fixed bit depth, so we treat them as >= 24
Diffstat (limited to 'libhb/common.c')
-rw-r--r--libhb/common.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libhb/common.c b/libhb/common.c
index ef067f545..3c0cc0cb5 100644
--- a/libhb/common.c
+++ b/libhb/common.c
@@ -1775,10 +1775,16 @@ int hb_audio_dither_get_default_method()
return SWR_DITHER_TRIANGULAR;
}
-int hb_audio_dither_is_supported(uint32_t codec)
+int hb_audio_dither_is_supported(uint32_t codec, int depth)
{
// Since dithering is performed by swresample, all codecs are supported
- return 1;
+ switch (codec)
+ {
+ case HB_ACODEC_FFFLAC:
+ if (depth == 0 || depth > 16)
+ return 1;
+ }
+ return 0;
}
int hb_audio_dither_get_from_name(const char *name)