summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/ad_faad.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs/ad_faad.c')
-rw-r--r--libmpcodecs/ad_faad.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libmpcodecs/ad_faad.c b/libmpcodecs/ad_faad.c
index 2dc6c1f580..96abaa5a6d 100644
--- a/libmpcodecs/ad_faad.c
+++ b/libmpcodecs/ad_faad.c
@@ -25,6 +25,7 @@
#include <unistd.h>
#include "config.h"
+#include "options.h"
#include "ad_internal.h"
#include "libaf/reorder_ch.h"
@@ -83,6 +84,7 @@ static int aac_probe(unsigned char *buffer, int len)
static int init(sh_audio_t *sh)
{
+ struct MPOpts *opts = sh->opts;
unsigned long faac_samplerate;
unsigned char faac_channels;
int faac_init, pos = 0;
@@ -105,7 +107,8 @@ static int init(sh_audio_t *sh)
/* XXX: FAAD support FLOAT output, how do we handle
* that (FAAD_FMT_FLOAT)? ::atmos
*/
- if (audio_output_channels <= 2) faac_conf->downMatrix = 1;
+ if (opts->audio_output_channels <= 2)
+ faac_conf->downMatrix = 1;
switch(sh->samplesize){
case 1: // 8Bit
mp_msg(MSGT_DECAUDIO,MSGL_WARN,"FAAD: 8Bit samplesize not supported by FAAD, assuming 16Bit!\n");
@@ -177,7 +180,7 @@ static int init(sh_audio_t *sh)
} else { // We have ES DS in codecdata
faacDecConfigurationPtr faac_conf = faacDecGetCurrentConfiguration(faac_hdec);
- if (audio_output_channels <= 2) {
+ if (opts->audio_output_channels <= 2) {
faac_conf->downMatrix = 1;
faacDecSetConfiguration(faac_hdec, faac_conf);
}
@@ -199,7 +202,8 @@ static int init(sh_audio_t *sh)
mp_msg(MSGT_DECAUDIO,MSGL_V,"FAAD: Negotiated samplerate: %ldHz channels: %d\n", faac_samplerate, faac_channels);
// 8 channels is aac channel order #7.
sh->channels = faac_channels == 7 ? 8 : faac_channels;
- if (audio_output_channels <= 2) sh->channels = faac_channels > 1 ? 2 : 1;
+ if (opts->audio_output_channels <= 2)
+ sh->channels = faac_channels > 1 ? 2 : 1;
sh->samplerate = faac_samplerate;
sh->samplesize=2;
//sh->o_bps = sh->samplesize*faac_channels*faac_samplerate;