From 9f3406ffc3bbe84ff01c034dc0dab62ff476c04f Mon Sep 17 00:00:00 2001 From: Paul Giblock Date: Sat, 23 Aug 2008 04:21:36 +0000 Subject: [PATCH] Fix warning about depreciated alsa function in new alsa versions git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1472 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 4 ++++ src/core/audio/audio_alsa.cpp | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4441ba844c..754f7c04e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,10 @@ * src/core/lfo_controller.cpp: Fix various casting warnings + * src/core/audio/audio_alsa.cpp: + Fix warning about obsolete snd_pcm_sw_params_set_xfer_align(). + ALSA >= 1.0.16 defaults to 1 now. + 2008-08-22 Tobias Doerffel * src/core/main.cpp: diff --git a/src/core/audio/audio_alsa.cpp b/src/core/audio/audio_alsa.cpp index cfe9919c14..823184782f 100644 --- a/src/core/audio/audio_alsa.cpp +++ b/src/core/audio/audio_alsa.cpp @@ -29,7 +29,6 @@ #include #include - #include "audio_alsa.h" #ifdef LMMS_HAVE_ALSA @@ -455,6 +454,8 @@ int audioALSA::setSWParams( void ) } // align all transfers to 1 sample + +#if SND_LIB_VERSION < ((1<<16)|(0)|16) if( ( err = snd_pcm_sw_params_set_xfer_align( m_handle, m_swParams, 1 ) ) < 0 ) { @@ -462,6 +463,7 @@ int audioALSA::setSWParams( void ) snd_strerror( err ) ); return( err ); } +#endif // write the parameters to the playback device if( ( err = snd_pcm_sw_params( m_handle, m_swParams ) ) < 0 )