Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Walker <tdskywalker@gmail.com>2014-04-13 00:11:53 +0400
committerTim Walker <tdskywalker@gmail.com>2014-05-08 01:51:01 +0400
commit194d12345d86c15b20b7e44a3679c9df3075d7f6 (patch)
tree111d93619d9205692181e62d570a9394af7503f7
parentb3d8276d2dc913d708d187fb15f6e98869d00500 (diff)
dcadec: Use correct channel count in stereo downmix check
s->prim_channels is greater than num_core_channels when an XCh extension is present in the bitstream. Signed-off-by: Luca Barbato <lu_zero@gentoo.org> (cherry picked from commit 801c39e1e3058fc4ba822bfb5d8612d777111e32)
-rw-r--r--libavcodec/dcadec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index cfce654561..ce8660d2b0 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -1896,7 +1896,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
s->channel_order_tab[channels - 1 - !!s->lfe] < 0)
return AVERROR_INVALIDDATA;
- if (s->prim_channels + !!s->lfe > 2 &&
+ if (num_core_channels + !!s->lfe > 2 &&
avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
channels = 2;
s->output = s->prim_channels == 2 ? s->amode : DCA_STEREO;
@@ -1910,7 +1910,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (s->core_downmix && (s->core_downmix_amode == DCA_STEREO ||
s->core_downmix_amode == DCA_STEREO_TOTAL)) {
int sign, code;
- for (i = 0; i < s->prim_channels + !!s->lfe; i++) {
+ for (i = 0; i < num_core_channels + !!s->lfe; i++) {
sign = s->core_downmix_codes[i][0] & 0x100 ? 1 : -1;
code = s->core_downmix_codes[i][0] & 0x0FF;
s->downmix_coef[i][0] = (!code ? 0.0f :
@@ -1928,19 +1928,19 @@ FF_ENABLE_DEPRECATION_WARNINGS
"Invalid channel mode %d\n", am);
return AVERROR_INVALIDDATA;
}
- if (s->prim_channels + !!s->lfe >
+ if (num_core_channels + !!s->lfe >
FF_ARRAY_ELEMS(dca_default_coeffs[0])) {
avpriv_request_sample(s->avctx, "Downmixing %d channels",
s->prim_channels + !!s->lfe);
return AVERROR_PATCHWELCOME;
}
- for (i = 0; i < s->prim_channels + !!s->lfe; i++) {
+ for (i = 0; i < num_core_channels + !!s->lfe; i++) {
s->downmix_coef[i][0] = dca_default_coeffs[am][i][0];
s->downmix_coef[i][1] = dca_default_coeffs[am][i][1];
}
}
av_dlog(s->avctx, "Stereo downmix coeffs:\n");
- for (i = 0; i < s->prim_channels + !!s->lfe; i++) {
+ for (i = 0; i < num_core_channels + !!s->lfe; i++) {
av_dlog(s->avctx, "L, input channel %d = %f\n", i,
s->downmix_coef[i][0]);
av_dlog(s->avctx, "R, input channel %d = %f\n", i,