---
libavcodec/mlp.h | 10 ++++++++++
libavcodec/mlp_parser.c | 7 +++++--
libavcodec/mlp_parser.h | 4 ++++
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/libavcodec/mlp.h b/libavcodec/mlp.h
index d771112..5a4ee5f 100644
--- a/libavcodec/mlp.h
+++ b/libavcodec/mlp.h
@@ -124,4 +124,14 @@ static inline uint8_t xor_32_to_8(uint32_t value)
return value;
}
+typedef enum THDChannelModifier {
+ THD_CH_MODIFIER_NOTINDICATED = 0x0,
+ THD_CH_MODIFIER_STEREO = 0x0, // Stereo (not Dolby Surround)
+ THD_CH_MODIFIER_LTRT = 0x1, // Dolby Surround
+ THD_CH_MODIFIER_LBINRBIN = 0x2, // Dolby Headphone
+ THD_CH_MODIFIER_MONO = 0x3, // Mono or Dual Mono
+ THD_CH_MODIFIER_NOTSURROUNDEX = 0x1, // Not Dolby Digital EX
+ THD_CH_MODIFIER_SURROUNDEX = 0x2, // Dolby Digital EX
+} THDChannelModifier;
+
#endif /* AVCODEC_MLP_H */
diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c
index 1a68014..8766bd0 100644
--- a/libavcodec/mlp_parser.c
+++ b/libavcodec/mlp_parser.c
@@ -169,13 +169,16 @@ int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh,
GetBitContext *gb)
mh->group1_samplerate = mlp_samplerate(ratebits);
mh->group2_samplerate = 0;
- skip_bits(gb, 8);
+ skip_bits(gb, 4);
+
+ mh->channel_modifier_thd_stream0 = get_bits(gb, 2);
+ mh->channel_modifier_thd_stream1 = get_bits(gb, 2);
channel_arrangement = get_bits(gb, 5);
mh->channels_thd_stream1 = truehd_channels(channel_arrangement);
mh->channel_layout_thd_stream1 = truehd_layout(channel_arrangement);
- skip_bits(gb, 2);
+ mh->channel_modifier_thd_stream2 = get_bits(gb, 2);
channel_arrangement = get_bits(gb, 13);
mh->channels_thd_stream2 = truehd_channels(channel_arrangement);
diff --git a/libavcodec/mlp_parser.h b/libavcodec/mlp_parser.h
index e874426..7530fac 100644
--- a/libavcodec/mlp_parser.h
+++ b/libavcodec/mlp_parser.h
@@ -39,6 +39,10 @@ typedef struct MLPHeaderInfo
int group1_samplerate; ///< Sample rate of first substream
int group2_samplerate; ///< Sample rate of second
substream (MLP only)
+ int channel_modifier_thd_stream0; ///< Channel modifier for
substream 0 of TrueHD sreams ("2-channel presentation")
+ int channel_modifier_thd_stream1; ///< Channel modifier for
substream 1 of TrueHD sreams ("6-channel presentation")
+ int channel_modifier_thd_stream2; ///< Channel modifier for
substream 2 of TrueHD sreams ("8-channel presentation")
+
int channels_mlp; ///< Channel count for MLP streams
int channels_thd_stream1; ///< Channel count for substream 1
of TrueHD streams ("6-channel presentation")
int channels_thd_stream2; ///< Channel count for substream 2
of TrueHD streams ("8-channel presentation")
--
1.8.3.4 (Apple Git-47)
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel