summaryrefslogtreecommitdiffstats
path: root/libhb/encavcodecaudio.c
diff options
context:
space:
mode:
authorRodeo <[email protected]>2013-02-05 17:53:03 +0000
committerRodeo <[email protected]>2013-02-05 17:53:03 +0000
commit5ca5ec3e6f4ebb47e92984a4ef859510df56b537 (patch)
tree22dbb88491ce5e6d7b8c844ebdb79581993f2e52 /libhb/encavcodecaudio.c
parent4017dfc2050336c4476f89fd4c4e358449b9376e (diff)
Audio dithering.
Works with encoders that accept 16-bit signed integers as input (currently, only ffflac). When supported, the default method is standard triangular. CLI users can request a specific dither algorithm via the --adither option. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5241 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/encavcodecaudio.c')
-rw-r--r--libhb/encavcodecaudio.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libhb/encavcodecaudio.c b/libhb/encavcodecaudio.c
index 669691dc1..ecd75ff98 100644
--- a/libhb/encavcodecaudio.c
+++ b/libhb/encavcodecaudio.c
@@ -148,6 +148,16 @@ static int encavcodecaInit(hb_work_object_t *w, hb_job_t *job)
context->channel_layout, 0);
av_opt_set_int(pv->avresample, "out_channel_layout",
context->channel_layout, 0);
+ if (hb_audio_dither_is_supported(audio->config.out.codec))
+ {
+ // dithering needs the sample rate
+ av_opt_set_int(pv->avresample, "in_sample_rate",
+ context->sample_rate, 0);
+ av_opt_set_int(pv->avresample, "out_sample_rate",
+ context->sample_rate, 0);
+ av_opt_set_int(pv->avresample, "dither_method",
+ audio->config.out.dither_method, 0);
+ }
if (avresample_open(pv->avresample))
{
hb_error("encavcodecaInit: avresample_open() failed");