summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Yves Avenard <jyavenard@mythtv.org>2011-10-09 09:47:17 (GMT)
committer Jean-Yves Avenard <jyavenard@mythtv.org>2011-10-09 09:58:17 (GMT)
commita24ecbf706b2989a5a6cb583d5efad50719d5454 (patch)
tree1e3a55b22a0f16fc146ef30316ac1517db5173f3
parent35468d7d5ce5af18280c8753775e3b54f7ceaf40 (diff)
Add ALSA playback support for 24 bits LSB audio.
Fixes #10081
-rw-r--r--mythtv/libs/libmyth/audiooutputalsa.cpp22
-rw-r--r--mythtv/libs/libmyth/audiooutputsettings.cpp2
2 files changed, 14 insertions, 10 deletions
diff --git a/mythtv/libs/libmyth/audiooutputalsa.cpp b/mythtv/libs/libmyth/audiooutputalsa.cpp
index 371f808..2fe1846 100644
--- a/mythtv/libs/libmyth/audiooutputalsa.cpp
+++ b/mythtv/libs/libmyth/audiooutputalsa.cpp
@@ -339,11 +339,12 @@ AudioOutputSettings* AudioOutputALSA::GetOutputSettings()
{
switch (fmt)
{
- case FORMAT_U8: afmt = SND_PCM_FORMAT_U8; break;
- case FORMAT_S16: afmt = SND_PCM_FORMAT_S16; break;
- case FORMAT_S24: afmt = SND_PCM_FORMAT_S24; break;
- case FORMAT_S32: afmt = SND_PCM_FORMAT_S32; break;
- case FORMAT_FLT: afmt = SND_PCM_FORMAT_FLOAT; break;
+ case FORMAT_U8: afmt = SND_PCM_FORMAT_U8; break;
+ case FORMAT_S16: afmt = SND_PCM_FORMAT_S16; break;
+ case FORMAT_S24LSB: afmt = SND_PCM_FORMAT_S24; break;
+ case FORMAT_S24: afmt = SND_PCM_FORMAT_S32; break;
+ case FORMAT_S32: afmt = SND_PCM_FORMAT_S32; break;
+ case FORMAT_FLT: afmt = SND_PCM_FORMAT_FLOAT; break;
default: continue;
}
if (snd_pcm_hw_params_test_format(pcm_handle, params, afmt) >= 0)
@@ -415,11 +416,12 @@ bool AudioOutputALSA::OpenDevice()
switch (output_format)
{
- case FORMAT_U8: format = SND_PCM_FORMAT_U8; break;
- case FORMAT_S16: format = SND_PCM_FORMAT_S16; break;
- case FORMAT_S24: format = SND_PCM_FORMAT_S24; break;
- case FORMAT_S32: format = SND_PCM_FORMAT_S32; break;
- case FORMAT_FLT: format = SND_PCM_FORMAT_FLOAT; break;
+ case FORMAT_U8: format = SND_PCM_FORMAT_U8; break;
+ case FORMAT_S16: format = SND_PCM_FORMAT_S16; break;
+ case FORMAT_S24LSB: format = SND_PCM_FORMAT_S24; break;
+ case FORMAT_S24: format = SND_PCM_FORMAT_S32; break;
+ case FORMAT_S32: format = SND_PCM_FORMAT_S32; break;
+ case FORMAT_FLT: format = SND_PCM_FORMAT_FLOAT; break;
default:
Error(QString("Unknown sample format: %1").arg(output_format));
return false;
diff --git a/mythtv/libs/libmyth/audiooutputsettings.cpp b/mythtv/libs/libmyth/audiooutputsettings.cpp
index 2f0ce19..d2e7e77 100644
--- a/mythtv/libs/libmyth/audiooutputsettings.cpp
+++ b/mythtv/libs/libmyth/audiooutputsettings.cpp
@@ -125,6 +125,8 @@ AudioFormat AudioOutputSettings::GetNextFormat()
void AudioOutputSettings::AddSupportedFormat(AudioFormat format)
{
+ VERBOSE(VB_AUDIO, LOC + QString("Format %1 is supported")
+ .arg(FormatToString(format)));
m_formats.push_back(format);
}