summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2012-02-09 16:01:36 +0100
committerJohns <johns98@gmx.net>2012-02-09 16:01:36 +0100
commit8c16466d318350b769615ee365ecc2b6a85dda5d (patch)
tree4ef965fb993d373268fdae7e4e3a4bd668ef15e8
parentced54a5cf15e49c3da6baed3ad2a0758d2897735 (diff)
downloadvdr-plugin-softhddevice-8c16466d318350b769615ee365ecc2b6a85dda5d.tar.gz
vdr-plugin-softhddevice-8c16466d318350b769615ee365ecc2b6a85dda5d.tar.bz2
Set mixer channel through command line option
-rw-r--r--ChangeLog1
-rw-r--r--audio.c14
-rw-r--r--audio.h3
-rw-r--r--softhddev.c10
4 files changed, 23 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index fc9167c..7afc013 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
User johns
Date:
+ Mixer channel could be set through command line option.
Fix bug: LFE moved to wrong position.
Guard suspend/resume against multiple calls.
Add support for AAC LATM audio streams.
diff --git a/audio.c b/audio.c
index 4a72161..5dec74a 100644
--- a/audio.c
+++ b/audio.c
@@ -822,7 +822,7 @@ static void AlsaInitMixer(void)
const char *name;
name = snd_mixer_selem_get_name(alsa_mixer_elem);
- if (strcasecmp(name, alsa_mixer_elem_name) == 0) {
+ if (!strcasecmp(name, alsa_mixer_elem_name)) {
snd_mixer_selem_get_playback_volume_range(alsa_mixer_elem,
&alsa_mixer_elem_min, &alsa_mixer_elem_max);
AlsaRatio =
@@ -2151,6 +2151,18 @@ void AudioSetDeviceAC3(const char *device)
}
/**
+** Set pcm audio mixer channel.
+**
+** @param channel name of the mixer channel (fe. PCM or Master)
+**
+** @note this is currently used to select alsa/OSS output module.
+*/
+void AudioSetChannel(const char *channel)
+{
+ AudioMixerChannel = channel;
+}
+
+/**
** Initialize audio output module.
**
** @todo FIXME: make audio output module selectable.
diff --git a/audio.h b/audio.h
index 292e1ae..f0dedab 100644
--- a/audio.h
+++ b/audio.h
@@ -43,7 +43,8 @@ extern int AudioSetup(int *, int *, int); ///< setup audio output
//extern void AudioPause(void); ///< pause audio
extern void AudioSetDevice(const char *); ///< set PCM audio device
-extern void AudioSetDeviceAC3(const char *); ///< set Passthrough device
+extern void AudioSetDeviceAC3(const char *); ///< set pass-through device
+extern void AudioSetChannel(const char *); ///< set mixer channel
extern void AudioInit(void); ///< setup audio module
extern void AudioExit(void); ///< cleanup and exit audio module
diff --git a/softhddev.c b/softhddev.c
index 77e026f..40f8125 100644
--- a/softhddev.c
+++ b/softhddev.c
@@ -1230,7 +1230,8 @@ void OsdDrawARGB(int x, int y, int height, int width, const uint8_t * argb)
const char *CommandLineHelp(void)
{
return " -a device\taudio device (fe. alsa: hw:0,0 oss: /dev/dsp)\n"
- " -p device\taudio device (alsa only) for pass-through (hw:0,1)\n"
+ " -p device\taudio device for pass-through (hw:0,1 or /dev/dsp1)\n"
+ " -c channel\taudio mixer channel name (fe. PCM)\n"
" -d display\tdisplay of x11 server (fe. :0.0)\n"
" -f\t\tstart with fullscreen window (only with window manager)\n"
" -g geometry\tx11 window geometry wxh+x+y\n"
@@ -1253,10 +1254,13 @@ int ProcessArgs(int argc, char *const argv[])
// Parse arguments.
//
for (;;) {
- switch (getopt(argc, argv, "-a:d:fg:p:sw:x")) {
- case 'a': // audio device
+ switch (getopt(argc, argv, "-a:c:d:fg:p:sw:x")) {
+ case 'a': // audio device for pcm
AudioSetDevice(optarg);
continue;
+ case 'c': // channel of audio mixer
+ AudioSetChannel(optarg);
+ continue;
case 'p': // pass-through audio device
AudioSetDeviceAC3(optarg);
continue;