diff options
author | Rodeo <[email protected]> | 2011-09-09 02:37:16 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2011-09-09 02:37:16 +0000 |
commit | a25b6621a54eef55fffbfe9d2cfb4987327e3434 (patch) | |
tree | e067d9e73f6a1775acd9d9e73f78691b0547bb1a /libhb/hb.c | |
parent | c3c4a5b9ed6baa30f35d5701148b2a755b98817f (diff) |
libhb: work around the lack of 6.1 support for DTS sources
libhb doesn't support 6.1 sources and assumes they're 7.0 instead. This breaks downmixing.
Libav can decode the DTS-ES 6.1 core of DTS-HD 6.1 audio tracks; tell it to not process the additional channel so that such tracks can be re-encoded correctly.
See https://reviews.handbrake.fr/r/200/ for more information.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4209 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/hb.c')
-rw-r--r-- | libhb/hb.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libhb/hb.c b/libhb/hb.c index f9bbcdc83..8ca3918ad 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -316,6 +316,22 @@ void hb_ff_set_sample_fmt(AVCodecContext *context, AVCodec *codec) } } +// Libav can decode DTS-ES 6.1 (5.1 core + XCh extension) +// but we don't support 6.1 (and incorrectly assume 7.0) +// request 6 channels to disable XCh processing in Libav +int hb_ff_dts_request_5point1( AVCodecContext *c ) +{ + if( ( c->codec_id == CODEC_ID_DTS ) && + ( c->channels == 7 ) && + ( c->channel_layout & ( AV_CH_BACK_CENTER|AV_CH_LOW_FREQUENCY ) ) ) + { + c->request_channels = c->channels = 6; + c->channel_layout &= ~AV_CH_BACK_CENTER; + return 1; + } + return 0; +} + /** * Registers work objects, by adding the work object to a liked list. * @param w Handle to hb_work_object_t to register. |