diff options
author | topfs2 <topfs2@svn> | 2009-10-17 14:42:44 +0000 |
---|---|---|
committer | topfs2 <topfs2@svn> | 2009-10-17 14:42:44 +0000 |
commit | 9b289c1b25f6119f757b31e85142df5c75ae958e (patch) | |
tree | 0311e749d51b7ffa177a8c4838674b22eb5ecae4 | |
parent | 331931492de8d93200eeaa221e468833e96f548b (diff) |
No point in enumerating card specific PCM's from ALSA if only one card.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@23796 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r-- | xbmc/cores/AudioRenderers/ALSADirectSound.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/xbmc/cores/AudioRenderers/ALSADirectSound.cpp b/xbmc/cores/AudioRenderers/ALSADirectSound.cpp index e6831cf78b..bf0555499d 100644 --- a/xbmc/cores/AudioRenderers/ALSADirectSound.cpp +++ b/xbmc/cores/AudioRenderers/ALSADirectSound.cpp @@ -552,11 +552,19 @@ void CALSADirectSound::EnumerateAudioSinks(AudioSinkList& vAudioSinks, bool pass vAudioSinks.push_back(AudioSink("HDMI" , "alsa:hdmi")); } + int n_cards = -1; + int numberCards = 0; + while ( snd_card_next( &n_cards ) == 0 && n_cards >= 0 ) + numberCards++; + + if (numberCards <= 1) + return; + snd_ctl_t *handle; snd_ctl_card_info_t *info; snd_ctl_card_info_alloca( &info ); - int n_cards = -1; CStdString strHwName; + n_cards = -1; while ( snd_card_next( &n_cards ) == 0 && n_cards >= 0 ) { |