Store pass-through on/off state in setup.

This commit is contained in:
Johns 2013-02-13 17:23:18 +01:00
parent 7b2caac901
commit 240fc17471
2 changed files with 33 additions and 14 deletions

View File

@ -156,12 +156,13 @@ Setup: /etc/vdr/setup.conf
delay audio or delay video delay audio or delay video
softhddevice.AudioPassthrough = 0 softhddevice.AudioPassthrough = 0
0 = none, 1 = PCM, 2 = MPA, 4 = AC-3, 8 = EAC-3 0 = none, 1 = PCM, 2 = MPA, 4 = AC-3, 8 = EAC-3, -X disable
for PCM/AC-3/EAC-3 the pass-through device is used and the audio for PCM/AC-3/EAC-3 the pass-through device is used and the audio
stream is passed undecoded to the output device. stream is passed undecoded to the output device.
z.b. 12 = AC-3+EAC-3, 13 = PCM+AC-3+EAC-3 z.b. 12 = AC-3+EAC-3, 13 = PCM+AC-3+EAC-3
note: MPA/DTS/TrueHD/... aren't supported yet note: MPA/DTS/TrueHD/... aren't supported yet
negative values disable passthrough
softhddevice.AudioDownmix = 0 softhddevice.AudioDownmix = 0
0 = none, 1 = downmix 0 = none, 1 = downmix

View File

@ -52,7 +52,7 @@ extern "C"
/// vdr-plugin version number. /// vdr-plugin version number.
/// Makefile extracts the version number for generating the file name /// Makefile extracts the version number for generating the file name
/// for the distribution archive. /// for the distribution archive.
static const char *const VERSION = "0.6.0" static const char *const VERSION = "0.6.0rc2"
#ifdef GIT_REV #ifdef GIT_REV
"-GIT" GIT_REV "-GIT" GIT_REV
#endif #endif
@ -618,6 +618,7 @@ class cMenuSetupSoft:public cMenuSetupPage
int Audio; int Audio;
int AudioDelay; int AudioDelay;
int AudioDrift; int AudioDrift;
int AudioPassthroughDefault;
int AudioPassthroughPCM; int AudioPassthroughPCM;
int AudioPassthroughAC3; int AudioPassthroughAC3;
int AudioPassthroughEAC3; int AudioPassthroughEAC3;
@ -846,11 +847,13 @@ void cMenuSetupSoft::Create(void)
-1000, 1000)); -1000, 1000));
Add(new cMenuEditStraItem(tr("Audio drift correction"), &AudioDrift, 4, Add(new cMenuEditStraItem(tr("Audio drift correction"), &AudioDrift, 4,
audiodrift)); audiodrift));
Add(new cMenuEditBoolItem(tr("Enable PCM pass-through"), Add(new cMenuEditBoolItem(tr("Pass-through default"),
&AudioPassthroughDefault, trVDR("off"), trVDR("on")));
Add(new cMenuEditBoolItem(tr(" PCM pass-through"),
&AudioPassthroughPCM, trVDR("no"), trVDR("yes"))); &AudioPassthroughPCM, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr("Enable AC-3 pass-through"), Add(new cMenuEditBoolItem(tr(" AC-3 pass-through"),
&AudioPassthroughAC3, trVDR("no"), trVDR("yes"))); &AudioPassthroughAC3, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr("Enable EAC-3 pass-through"), Add(new cMenuEditBoolItem(tr(" EAC-3 pass-through"),
&AudioPassthroughEAC3, trVDR("no"), trVDR("yes"))); &AudioPassthroughEAC3, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr("Enable (E)AC-3 (decoder) downmix"), Add(new cMenuEditBoolItem(tr("Enable (E)AC-3 (decoder) downmix"),
&AudioDownmix, trVDR("no"), trVDR("yes"))); &AudioDownmix, trVDR("no"), trVDR("yes")));
@ -1037,6 +1040,7 @@ cMenuSetupSoft::cMenuSetupSoft(void)
Audio = 0; Audio = 0;
AudioDelay = ConfigVideoAudioDelay; AudioDelay = ConfigVideoAudioDelay;
AudioDrift = ConfigAudioDrift; AudioDrift = ConfigAudioDrift;
AudioPassthroughDefault = AudioPassthroughState;
AudioPassthroughPCM = ConfigAudioPassthrough & CodecPCM; AudioPassthroughPCM = ConfigAudioPassthrough & CodecPCM;
AudioPassthroughAC3 = ConfigAudioPassthrough & CodecAC3; AudioPassthroughAC3 = ConfigAudioPassthrough & CodecAC3;
AudioPassthroughEAC3 = ConfigAudioPassthrough & CodecEAC3; AudioPassthroughEAC3 = ConfigAudioPassthrough & CodecEAC3;
@ -1185,9 +1189,14 @@ void cMenuSetupSoft::Store(void)
ConfigAudioPassthrough = (AudioPassthroughPCM ? CodecPCM : 0) ConfigAudioPassthrough = (AudioPassthroughPCM ? CodecPCM : 0)
| (AudioPassthroughAC3 ? CodecAC3 : 0) | (AudioPassthroughAC3 ? CodecAC3 : 0)
| (AudioPassthroughEAC3 ? CodecEAC3 : 0); | (AudioPassthroughEAC3 ? CodecEAC3 : 0);
SetupStore("AudioPassthrough", ConfigAudioPassthrough); AudioPassthroughState = AudioPassthroughDefault;
CodecSetAudioPassthrough(ConfigAudioPassthrough); if (AudioPassthroughState) {
AudioPassthroughState = 1; SetupStore("AudioPassthrough", ConfigAudioPassthrough);
CodecSetAudioPassthrough(ConfigAudioPassthrough);
} else {
SetupStore("AudioPassthrough", -ConfigAudioPassthrough);
CodecSetAudioPassthrough(0);
}
SetupStore("AudioDownmix", ConfigAudioDownmix = AudioDownmix); SetupStore("AudioDownmix", ConfigAudioDownmix = AudioDownmix);
CodecSetAudioDownmix(ConfigAudioDownmix); CodecSetAudioDownmix(ConfigAudioDownmix);
SetupStore("AudioSoftvol", ConfigAudioSoftvol = AudioSoftvol); SetupStore("AudioSoftvol", ConfigAudioSoftvol = AudioSoftvol);
@ -2559,11 +2568,14 @@ class cPluginSoftHdDevice:public cPlugin
virtual cString SVDRPCommand(const char *, const char *, int &); virtual cString SVDRPCommand(const char *, const char *, int &);
}; };
/**
** Initialize any member variables here.
**
** @note DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL
** VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT!
*/
cPluginSoftHdDevice::cPluginSoftHdDevice(void) cPluginSoftHdDevice::cPluginSoftHdDevice(void)
{ {
// Initialize any member variables here.
// DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL
// VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT!
//dsyslog("[softhddev]%s:\n", __FUNCTION__); //dsyslog("[softhddev]%s:\n", __FUNCTION__);
} }
@ -2918,9 +2930,15 @@ bool cPluginSoftHdDevice::SetupParse(const char *name, const char *value)
return true; return true;
} }
if (!strcasecmp(name, "AudioPassthrough")) { if (!strcasecmp(name, "AudioPassthrough")) {
CodecSetAudioPassthrough(ConfigAudioPassthrough = atoi(value)); int i;
if (ConfigAudioPassthrough) {
AudioPassthroughState = 1; i = atoi(value);
AudioPassthroughState = i > 0;
ConfigAudioPassthrough = abs(i);
if (AudioPassthroughState) {
CodecSetAudioPassthrough(ConfigAudioPassthrough);
} else {
CodecSetAudioPassthrough(0);
} }
return true; return true;
} }