Permalink
Browse files

Add ALSA playback support for 24 bits LSB audio.

Fixes #10081
  • Loading branch information...
1 parent 634e8b1 commit 3dd7439c498a372718b6d8e449cc75340a724324 @jyavenard jyavenard committed Oct 9, 2011
Showing with 14 additions and 10 deletions.
  1. +12 −10 mythtv/libs/libmyth/audio/audiooutputalsa.cpp
  2. +2 −0 mythtv/libs/libmyth/audio/audiooutputsettings.cpp
View
22 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;
View
2 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);
}

0 comments on commit 3dd7439

Please sign in to comment.