From 4e8cae716ad3fdf29a7b2a45e5eec0a530f93277 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Tue, 16 May 2006 14:58:11 +0000 Subject: add ability to selecte the audio channel (mono left, stereo, mono right) from python store the current selected audio channel then per service in servicelist TODO: extend the audio track selection screen to make audio channel selection usable :) --- lib/dvb/decoder.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'lib/dvb/decoder.cpp') diff --git a/lib/dvb/decoder.cpp b/lib/dvb/decoder.cpp index 1bec997d..76d0f504 100644 --- a/lib/dvb/decoder.cpp +++ b/lib/dvb/decoder.cpp @@ -137,6 +137,22 @@ void eDVBAudio::unfreeze() eDebug("video: AUDIO_CONTINUE: %m"); } +void eDVBAudio::setChannel(int channel) +{ + int val = AUDIO_STEREO; + switch (channel) + { + case aMonoLeft: val = AUDIO_MONO_LEFT; break; + case aMonoRight: val = AUDIO_MONO_RIGHT; break; + default: + break; + } + if (::ioctl(m_fd, AUDIO_CHANNEL_SELECT, val) < 0) + eDebug("video: AUDIO_CHANNEL_SELECT: %m"); + else + eDebug("AUDIO_CHANNEL_SELECT ok"); +} + int eDVBAudio::getPTS(pts_t &now) { return ::ioctl(m_fd, AUDIO_GET_PTS, &now); @@ -552,6 +568,15 @@ RESULT eTSMPEGDecoder::setAudioPID(int apid, int type) return 0; } +RESULT eTSMPEGDecoder::setAudioChannel(int channel) +{ + if (m_audio) + m_audio->setChannel(channel); + else + eDebug("eTSMPEGDecoder::setAudioChannel but no audio decoder exist"); + return 0; +} + RESULT eTSMPEGDecoder::setSyncPCR(int pcrpid) { if (m_pcrpid != pcrpid) -- cgit v1.2.3