Browse Source

(e)ac3: clip surround mix level indexes.

Values 0-2 are reserved, 3 (-1.5dB) should be used instead.
tags/n2.2-rc1
Tim Walker 11 years ago
parent
commit
ade75fb811
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      libavcodec/ac3dec.c
  2. +2
    -2
      libavcodec/eac3dec.c

+ 2
- 2
libavcodec/ac3dec.c View File

@@ -237,9 +237,9 @@ static int ac3_parse_header(AC3DecodeContext *s)
if (get_bits1(gbc)) {
s->preferred_downmix = get_bits(gbc, 2);
s->center_mix_level_ltrt = get_bits(gbc, 3);
s->surround_mix_level_ltrt = get_bits(gbc, 3);
s->surround_mix_level_ltrt = av_clip(get_bits(gbc, 3), 3, 7);
s->center_mix_level = get_bits(gbc, 3);
s->surround_mix_level = get_bits(gbc, 3);
s->surround_mix_level = av_clip(get_bits(gbc, 3), 3, 7);
}
if (get_bits1(gbc)) {
s->dolby_surround_ex_mode = get_bits(gbc, 2);


+ 2
- 2
libavcodec/eac3dec.c View File

@@ -353,8 +353,8 @@ int ff_eac3_parse_header(AC3DecodeContext *s)
}
if (s->channel_mode & 4) {
/* if a surround channel exists */
s->surround_mix_level_ltrt = get_bits(gbc, 3);
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);
}
}



Loading…
Cancel
Save