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:47:17 (GMT)
commit3dd7439c498a372718b6d8e449cc75340a724324 (patch)
tree326b4cc57665fe07669d89046b934e016adc4b95
parent634e8b11f0b0cacacee55f474a35a3b2e45b9631 (diff)
Add ALSA playback support for 24 bits LSB audio.
Fixes #10081
-rw-r--r--mythtv/libs/libmyth/audio/audiooutputalsa.cpp22
-rw-r--r--mythtv/libs/libmyth/audio/audiooutputsettings.cpp2
2 files changed, 14 insertions, 10 deletions
diff --git a/mythtv/libs/libmyth/audio/audiooutputalsa.cpp b/mythtv/libs/libmyth/audio/audiooutputalsa.cpp
index fe0f752..63c5057 100644
--- a/mythtv/libs/libmyth/audio/audiooutputalsa.cpp
+++ b/mythtv/libs/libmyth/audio/audiooutputalsa.cpp
@@ -341,11 +341,12 @@ AudioOutputSettings* AudioOutputALSA::GetOutputSettings(bool passthrough)
{
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)
@@ -418,11 +419,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/audio/audiooutputsettings.cpp b/mythtv/libs/libmyth/audio/audiooutputsettings.cpp
index ee03717..c762fee 100644
--- a/mythtv/libs/libmyth/audio/audiooutputsettings.cpp
+++ b/mythtv/libs/libmyth/audio/audiooutputsettings.cpp
@@ -129,6 +129,8 @@ AudioFormat AudioOutputSettings::GetNextFormat()
void AudioOutputSettings::AddSupportedFormat(AudioFormat format)
{
+ LOG(VB_AUDIO, LOG_INFO, LOC +
+ QString("Format %1 is supported").arg(FormatToString(format)));
m_formats.push_back(format);
}