VirtualBox

Changeset 98089 in vbox


Ignore:
Timestamp:
Jan 16, 2023 9:32:37 AM (23 months ago)
Author:
vboxsync
Message:

Audio/Settings: Compile fixes if VBOX_WITH_AUDIO_PULSE and VBOX_WITH_AUDIO_ALSA are not defined; cleaned up the function a bit to not go even deeper in the #ifdef hell. Keep it simple.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/xml/Settings.cpp

    r96888 r98089  
    89268926
    89278927#elif defined(RT_OS_LINUX)
    8928     /* On Linux, we need to check at runtime what's actually supported. */
     8928    /* On Linux, we need to check at runtime what's actually supported.
     8929     * Descending precedence. */
    89298930    static RTCLockMtx s_mtx;
    89308931    static AudioDriverType_T s_enmLinuxDriver = AudioDriverType_Null;
    89318932    RTCLock lock(s_mtx);
    8932     if (s_enmLinuxDriver == AudioDriverType_Null)
     8933    if (s_enmLinuxDriver == AudioDriverType_Null) /* Already determined from a former run? */
    89338934    {
    89348935# ifdef VBOX_WITH_AUDIO_PULSE
    89358936        /* Check for the pulse library & that the pulse audio daemon is running. */
    8936         if (RTProcIsRunningByName("pulseaudio") &&
    8937             RTLdrIsLoadable("libpulse.so.0"))
     8937        if (   RTProcIsRunningByName("pulseaudio")
     8938            && RTLdrIsLoadable("libpulse.so.0"))
     8939        {
    89388940            s_enmLinuxDriver = AudioDriverType_Pulse;
    8939         else
    8940 # endif /* VBOX_WITH_AUDIO_PULSE */
     8941        }
     8942#endif /* VBOX_WITH_AUDIO_PULSE */
     8943
    89418944# ifdef VBOX_WITH_AUDIO_ALSA
     8945        if (s_enmLinuxDriver == AudioDriverType_Null)
     8946        {
    89428947            /* Check if we can load the ALSA library */
    8943              if (RTLdrIsLoadable("libasound.so.2"))
     8948            if (RTLdrIsLoadable("libasound.so.2"))
    89448949                s_enmLinuxDriver = AudioDriverType_ALSA;
     8950        }
    89458951# endif /* VBOX_WITH_AUDIO_ALSA */
     8952
    89468953# ifdef VBOX_WITH_AUDIO_OSS
    8947              else
    8948                 s_enmLinuxDriver = AudioDriverType_OSS;
     8954        if (s_enmLinuxDriver == AudioDriverType_Null)
     8955            s_enmLinuxDriver = AudioDriverType_OSS;
    89498956# endif /* VBOX_WITH_AUDIO_OSS */
    89508957    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette