summaryrefslogtreecommitdiff
path: root/libavcodec/truehd_core_bsf.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-07-06 15:59:06 +0200
committerPaul B Mahol <onemda@gmail.com>2019-07-09 13:23:02 +0200
commit99c191151a716d8315e938297bd9b50a6a0902d3 (patch)
treef73f2934c07e044e4bb8d6d0486575b274ecfd51 /libavcodec/truehd_core_bsf.c
parentf83b46e2181c9eb0360cb61419f29a1e44f04954 (diff)
truehd_core: Disable 16-channel presentation
The most serious bit of the substream_info header field (in a mayor sync packet) indicates whether a 16-channel presentation is present in the bitstream. If set, the extended_substream_info header field contains information about the 16-channel presentation. This presentation always uses substream 3, a substream that is discarded by truehd_core. So substream_info needs to be changed to no longer indicate the presence of a 16-channel presentation in order for truehd_core's output to be consistent. This is implemented in this commit. This change also makes MediaInfo no longer display the presence of Atmos in the output of truehd_core. Also, set the (now irrelevant) extended_substream_info field to zero as this seems to be the common value for ordinary TrueHD. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/truehd_core_bsf.c')
-rw-r--r--libavcodec/truehd_core_bsf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/truehd_core_bsf.c b/libavcodec/truehd_core_bsf.c
index 9e3ee07eed..757d26a10d 100644
--- a/libavcodec/truehd_core_bsf.c
+++ b/libavcodec/truehd_core_bsf.c
@@ -121,7 +121,8 @@ static int truehd_core_filter(AVBSFContext *ctx, AVPacket *out)
AV_WN64(out->data + out_size - 8, 0);
if (have_header) {
memcpy(out->data + 4, in->data + 4, 28);
- out->data[16 + 4] = (out->data[16 + 4] & 0x0f) | (FFMIN(s->hdr.num_substreams, 3) << 4);
+ out->data[16 + 4] = (out->data[16 + 4] & 0x0c) | (FFMIN(s->hdr.num_substreams, 3) << 4);
+ out->data[17 + 4]&= 0x7f;
out->data[25 + 4] = out->data[25 + 4] & 0xfe;
out->data[26 + 4] = 0xff;
out->data[27 + 4] = 0xff;