summaryrefslogtreecommitdiffstats
path: root/libhb/decavcodec.c
diff options
context:
space:
mode:
authorRodeo <[email protected]>2014-01-26 16:12:23 +0000
committerRodeo <[email protected]>2014-01-26 16:12:23 +0000
commit1d7db22df59be148ed995eee7755f21d8f0b9d5b (patch)
tree32eb0acf048550576259f0798f8da0a7975c5703 /libhb/decavcodec.c
parentee621317fb45852db29b94308b87690827a9a0df (diff)
libhb: support AV_FRAME_DATA_MATRIXENCODING side data.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6000 b64f7644-9d1e-0410-96f1-a4d463321fa5
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;