Project

General

Profile

Feature #1259 ยป EAC3asAC3.diff

Anonymous, 02/16/2013 03:50 PM

View differences:

new/codec.c 2013-02-16 15:22:01.000000000 +0100
/// Pass-through flags: CodecPCM, CodecAC3, CodecEAC3, ...
///
static char CodecPassthrough;
static int CodecEAC3asAC3;
#else
static const int CodecPassthrough = 0;
static const int CodecEAC3asAC3 = 0;
#endif
static char CodecDownmix; ///< enable AC-3 decoder downmix
......
(void)mask;
}
void CodecSetAudioEAC3asAC3(int onoff)
{
#ifdef USE_PASSTHROUGH
CodecEAC3asAC3 = onoff;
#endif
(void)onoff;
}
/**
** Set audio downmix.
**
......
if ((CodecPassthrough & CodecAC3 && audio_ctx->codec_id == CODEC_ID_AC3)
|| (CodecPassthrough & CodecEAC3
&& audio_ctx->codec_id == CODEC_ID_EAC3)) {
if (audio_ctx->codec_id == CODEC_ID_EAC3) {
if (!CodecEAC3asAC3 && audio_ctx->codec_id == CODEC_ID_EAC3) {
// EAC3 over HDMI some receivers need HBR
audio_decoder->HwSampleRate *= 4;
}
......
if ((err =
AudioSetup(&audio_decoder->HwSampleRate,
&audio_decoder->HwChannels, *passthrough))) {
// try EAC3 none HBR
audio_decoder->HwSampleRate /= 4;
if (audio_ctx->codec_id != CODEC_ID_EAC3
if ((CodecEAC3asAC3 && audio_ctx->codec_id != CODEC_ID_EAC3)
|| (err =
AudioSetup(&audio_decoder->HwSampleRate,
&audio_decoder->HwChannels, *passthrough))) {
Debug(3, "codec/audio: audio setup error\n");
// FIXME: handle errors
audio_decoder->HwChannels = 0;
......
audio_ctx = audio_decoder->AudioCtx;
// SPDIF/HDMI passthrough
if (CodecPassthrough & CodecAC3 && audio_ctx->codec_id == CODEC_ID_AC3) {
if ((CodecPassthrough & CodecAC3 && audio_ctx->codec_id == CODEC_ID_AC3) || (CodecEAC3asAC3 &&
(CodecPassthrough & CodecEAC3 && audio_ctx->codec_id == CODEC_ID_EAC3))) {
uint16_t *spdif;
int spdif_sz;
......
AudioEnqueue(spdif, spdif_sz);
return 1;
}
if (CodecPassthrough & CodecEAC3 && audio_ctx->codec_id == CODEC_ID_EAC3) {
if (!CodecEAC3asAC3 && (CodecPassthrough & CodecEAC3 && audio_ctx->codec_id == CODEC_ID_EAC3)) {
uint16_t *spdif;
int spdif_sz;
int repeat;
new/codec.h 2013-02-16 15:00:36.000000000 +0100
/// Set audio pass-through.
extern void CodecSetAudioPassthrough(int);
/// Set handle EAC3 as AC3.
extern void CodecSetAudioEAC3asAC3(int);
/// Set audio downmix.
extern void CodecSetAudioDownmix(int);
new/softhddevice.cpp 2013-02-16 15:05:40.000000000 +0100
static int ConfigVideoAudioDelay; ///< config audio delay
static char ConfigAudioDrift; ///< config audio drift
static char ConfigAudioPassthrough; ///< config audio pass-through mask
static char ConfigAudioEAC3asAC3; ///< config audio handle EAC3 as AC3
static char AudioPassthroughState; ///< flag audio pass-through on/off
static char ConfigAudioDownmix; ///< config ffmpeg audio downmix
static char ConfigAudioSoftvol; ///< config use software volume
......
int AudioPassthroughPCM;
int AudioPassthroughAC3;
int AudioPassthroughEAC3;
int AudioEAC3asAC3;
int AudioDownmix;
int AudioSoftvol;
int AudioNormalize;
......
audiodrift));
Add(new cMenuEditBoolItem(tr("Pass-through default"),
&AudioPassthroughDefault, trVDR("off"), trVDR("on")));
Add(new cMenuEditBoolItem(tr(" PCM pass-through"),
Add(new cMenuEditBoolItem(tr("\040\040PCM pass-through"),
&AudioPassthroughPCM, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" AC-3 pass-through"),
Add(new cMenuEditBoolItem(tr("\040\040AC-3 pass-through"),
&AudioPassthroughAC3, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr(" EAC-3 pass-through"),
Add(new cMenuEditBoolItem(tr("\040\040EAC-3 pass-through"),
&AudioPassthroughEAC3, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr("\040\040\040Handle EAC3 as AC3"),
&AudioEAC3asAC3, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr("Enable (E)AC-3 (decoder) downmix"),
&AudioDownmix, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr("Volume control"), &AudioSoftvol,
......
AudioPassthroughPCM = ConfigAudioPassthrough & CodecPCM;
AudioPassthroughAC3 = ConfigAudioPassthrough & CodecAC3;
AudioPassthroughEAC3 = ConfigAudioPassthrough & CodecEAC3;
AudioEAC3asAC3 = ConfigAudioEAC3asAC3;
AudioDownmix = ConfigAudioDownmix;
AudioSoftvol = ConfigAudioSoftvol;
AudioNormalize = ConfigAudioNormalize;
......
SetupStore("AudioPassthrough", -ConfigAudioPassthrough);
CodecSetAudioPassthrough(0);
}
SetupStore("AudioEAC3asAC3", ConfigAudioEAC3asAC3 = AudioEAC3asAC3);
CodecSetAudioEAC3asAC3(ConfigAudioEAC3asAC3);
SetupStore("AudioDownmix", ConfigAudioDownmix = AudioDownmix);
CodecSetAudioDownmix(ConfigAudioDownmix);
SetupStore("AudioSoftvol", ConfigAudioSoftvol = AudioSoftvol);
    (1-1/1)