diff options
author | jstebbins <[email protected]> | 2010-10-08 20:30:53 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-10-08 20:30:53 +0000 |
commit | db3be3933c2b8eaf9df838028d065b847f987512 (patch) | |
tree | eee3a8b0ef0e259e73d3189ddf52f36ddd95b8e4 /test/test.c | |
parent | 2ee8b248c71daa96f5c010ae9a914db501c78e99 (diff) |
cli: make smarter mixdown decision when doing ac3 encode fallback
also, clean up the mixdown sanitizing logic in work.c
added new functions
hb_get_default_mix(codec, layout)
hb_get_best_mix(codec, layout)
These take the output codec and the input layout as parameters.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3580 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'test/test.c')
-rw-r--r-- | test/test.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/test/test.c b/test/test.c index 5cacd82b9..019bdb0ee 100644 --- a/test/test.c +++ b/test/test.c @@ -1796,26 +1796,11 @@ static int HandleEvents( hb_handle_t * h ) ( audio->out.codec & HB_ACODEC_PASS_FLAG ) && !( audio->out.codec & audio->in.codec ) ) { - int channels; audio->out.codec = HB_ACODEC_AC3; - channels = HB_INPUT_CH_LAYOUT_GET_DISCRETE_COUNT(audio->in.channel_layout); - // bitrate setting is a placeholder till we get - // defaults and limits implemented in libhb - if (channels == 1) - { - audio->out.mixdown = HB_AMIXDOWN_MONO; - audio->out.bitrate = 96; - } - if (channels == 2) - { - audio->out.mixdown = HB_AMIXDOWN_DOLBYPLII; - audio->out.bitrate = 224; - } - else - { - audio->out.mixdown = HB_AMIXDOWN_6CH; - audio->out.bitrate = 640; - } + audio->out.mixdown = hb_get_default_mixdown( audio->out.codec, audio->in.channel_layout ); + audio->out.bitrate = hb_get_default_audio_bitrate( + audio->out.codec, audio->out.samplerate, + audio->out.mixdown ); } // fix 'copy' to select a specific codec if ( audio->out.codec & HB_ACODEC_PASS_FLAG ) |