From 8e3918bce7b2e1e0e23cab69334df52b58d10f4d Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Mon, 23 Feb 2009 07:37:49 +0100 Subject: simplify audiochannel handling --- dxr3interface.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'dxr3interface.c') diff --git a/dxr3interface.c b/dxr3interface.c index 9eedf5c..8a9a523 100644 --- a/dxr3interface.c +++ b/dxr3interface.c @@ -192,17 +192,16 @@ void cDxr3Interface::SetAudioSpeed(uint32_t speed) //! set number of channels void cDxr3Interface::SetChannelCount(uint32_t count) { + // 0 = mono, 1 = stereo + uint32_t ioval = count - 1; + if (!m_ExternalReleased && m_audioMode != EM8300_AUDIOMODE_DIGITALAC3 && - m_audioChannelCount != count && count != UNKNOWN_CHANNEL_COUNT) - { - if (ioctl(m_fdAudio, SNDCTL_DSP_STEREO, &count) == -1) - { - esyslog("dxr3: unable to set channel count to %d: %m", count); - } - else - { - m_audioChannelCount = count; - } + m_audioChannelCount != count) { + if (ioctl(m_fdAudio, SNDCTL_DSP_STEREO, &ioval) == -1) { + esyslog("dxr3: unable to set channel count to %d: %m", count); + } else { + m_audioChannelCount = count; + } } } -- cgit v1.2.3