summaryrefslogtreecommitdiffstats
path: root/libhb/hb.c
diff options
context:
space:
mode:
Diffstat (limited to 'libhb/hb.c')
-rw-r--r--libhb/hb.c16
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.