application can select from. each independent stream can also contain
dependent streams which are used to add or replace channels. */
if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) {
- avpriv_request_sample(s->avctx, "Dependent substream decoding");
+ if (!s->eac3_frame_dependent_found) {
+ s->eac3_frame_dependent_found = 1;
+ avpriv_request_sample(s->avctx, "Dependent substream decoding");
+ }
return AAC_AC3_PARSE_ERROR_FRAME_TYPE;
} else if (s->frame_type == EAC3_FRAME_TYPE_RESERVED) {
av_log(s->avctx, AV_LOG_ERROR, "Reserved frame type\n");
associated to an independent stream have matching substream id's. */
if (s->substreamid) {
/* only decode substream with id=0. skip any additional substreams. */
- avpriv_request_sample(s->avctx, "Additional substreams");
+ if (!s->eac3_subsbtreamid_found) {
+ s->eac3_subsbtreamid_found = 1;
+ avpriv_request_sample(s->avctx, "Additional substreams");
+ }
return AAC_AC3_PARSE_ERROR_FRAME_TYPE;
}
}
}
- /* default dolby matrix encoding modes */
- s->dolby_surround_mode = AC3_DSURMOD_NOTINDICATED;
- s->dolby_surround_ex_mode = AC3_DSUREXMOD_NOTINDICATED;
- s->dolby_headphone_mode = AC3_DHEADPHONMOD_NOTINDICATED;
-
/* mixing metadata */
if (get_bits1(gbc)) {
/* center and surround mix levels */
if (s->channel_mode > AC3_CHMODE_STEREO) {
- skip_bits(gbc, 2); // skip preferred stereo downmix mode
+ s->preferred_downmix = get_bits(gbc, 2);
if (s->channel_mode & 1) {
/* if three front channels exist */
- skip_bits(gbc, 3); //skip Lt/Rt center mix level
- s->center_mix_level = get_bits(gbc, 3);
+ s->center_mix_level_ltrt = get_bits(gbc, 3);
+ s->center_mix_level = get_bits(gbc, 3);
}
if (s->channel_mode & 4) {
/* if a surround channel exists */
- skip_bits(gbc, 3); //skip Lt/Rt surround mix level
- s->surround_mix_level = get_bits(gbc, 3);
+ s->surround_mix_level_ltrt = av_clip(get_bits(gbc, 3), 3, 7);
+ s->surround_mix_level = av_clip(get_bits(gbc, 3), 3, 7);
}
}
/* lfe mix level */
- if (s->lfe_on && get_bits1(gbc)) {
- // TODO: use LFE mix level
- skip_bits(gbc, 5); // skip LFE mix level code
+ if (s->lfe_on && (s->lfe_mix_level_exists = get_bits1(gbc))) {
+ s->lfe_mix_level = get_bits(gbc, 5);
}
/* info for mixing with other streams and substreams */