summaryrefslogtreecommitdiffstats
path: root/libhb/decavcodec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libhb/decavcodec.c')
-rw-r--r--libhb/decavcodec.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c
index 1e760583b..73692de5f 100644
--- a/libhb/decavcodec.c
+++ b/libhb/decavcodec.c
@@ -721,10 +721,30 @@ static int decavcodecaBSInfo( hb_work_object_t *w, const hb_buffer_t *buf,
if (truehd_mono)
{
info->channel_layout = AV_CH_LAYOUT_MONO;
+ info->matrix_encoding = AV_MATRIX_ENCODING_NONE;
}
else
{
- info->channel_layout = frame->channel_layout;
+ AVFrameSideData *side_data;
+ if ((side_data =
+ av_frame_get_side_data(frame,
+ AV_FRAME_DATA_MATRIXENCODING)) != NULL)
+ {
+ info->matrix_encoding = *side_data->data;
+ }
+ else
+ {
+ info->matrix_encoding = AV_MATRIX_ENCODING_NONE;
+ }
+ if (info->matrix_encoding == AV_MATRIX_ENCODING_DOLBY ||
+ info->matrix_encoding == AV_MATRIX_ENCODING_DPLII)
+ {
+ info->channel_layout = AV_CH_LAYOUT_STEREO_DOWNMIX;
+ }
+ else
+ {
+ info->channel_layout = frame->channel_layout;
+ }
}
ret = 1;