diff options
author | Johns <johns98@gmx.net> | 2014-06-04 19:32:44 +0200 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2014-06-04 19:32:44 +0200 |
commit | 5207af6b2da0df19a58db4932811d38526fde51b (patch) | |
tree | 610de58ab507e054dfb062ecfbe551a6e389063e /audio.c | |
parent | 90538ebfa9e9fb29aab6a969cf812e045b2a37d8 (diff) | |
download | vdr-plugin-softhddevice-5207af6b2da0df19a58db4932811d38526fde51b.tar.gz vdr-plugin-softhddevice-5207af6b2da0df19a58db4932811d38526fde51b.tar.bz2 |
Fix last commit.
Diffstat (limited to 'audio.c')
-rw-r--r-- | audio.c | 37 |
1 files changed, 36 insertions, 1 deletions
@@ -1,7 +1,7 @@ /// /// @file audio.c @brief Audio module /// -/// Copyright (c) 2009 - 2013 by Johns. All Rights Reserved. +/// Copyright (c) 2009 - 2014 by Johns. All Rights Reserved. /// /// Contributor(s): /// @@ -132,6 +132,7 @@ static const char *AudioModuleName; ///< which audio module to use static const AudioModule *AudioUsedModule = &NoopModule; static const char *AudioPCMDevice; ///< PCM device name static const char *AudioPassthroughDevice; ///< Passthrough device name +static char AudioAppendAES; ///< flag automatic append AES static const char *AudioMixerDevice; ///< mixer device name static const char *AudioMixerChannel; ///< mixer channel name static char AudioDoingInit; ///> flag in init, reduce error @@ -1007,6 +1008,26 @@ static snd_pcm_t *AlsaOpenPCM(int passthrough) Info(_("audio/alsa: using %sdevice '%s'\n"), passthrough ? "pass-through " : "", device); } + // + // for AC3 pass-through try to set the non-audio bit, use AES0=6 + // + if (passthrough && AudioAppendAES) { +#if 0 + // FIXME: not yet finished + char *buf; + const char *s; + int n; + + n = strlen(device); + buf = alloca(n + sizeof(":AES0=6") + 1); + strcpy(buf, device); + if (!(s = strchr(buf, ':'))) { + // no alsa parameters + strcpy(buf + n, ":AES=6"); + } + Debug(3, "audio/alsa: try '%s'\n", buf); +#endif + } // open none blocking; if device is already used, we don't want wait if ((err = snd_pcm_open(&handle, device, SND_PCM_STREAM_PLAYBACK, @@ -2781,6 +2802,20 @@ void AudioSetChannel(const char *channel) } /** +** Set automatic AES flag handling. +** +** @param onoff turn setting AES flag on or off +*/ +void AudioSetAutoAES(int onoff) +{ + if (onoff < 0) { + AudioAppendAES ^= 1; + } else { + AudioAppendAES = onoff; + } +} + +/** ** Initialize audio output module. ** ** @todo FIXME: make audio output module selectable. |