summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/ad_faad.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-10-31 07:26:40 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:18:07 +0200
commit4de0369e8d6d8d497b3aa61044a152ae91d477a6 (patch)
treec723c2a64dcba73a21af87ea7ad25cf8026b279f /libmpcodecs/ad_faad.c
parent45e1333581d9409b2d2be22129f8f6365016b609 (diff)
downloadmpv-4de0369e8d6d8d497b3aa61044a152ae91d477a6.tar.bz2
mpv-4de0369e8d6d8d497b3aa61044a152ae91d477a6.tar.xz
options: move audio_output_channels, audio_output_format to struct
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;