VirtualBox

Ignore:
Timestamp:
Jul 20, 2010 4:53:40 PM (14 years ago)
Author:
vboxsync
Message:

Main: automatically fix host-specific audio drivers when loading machine settings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/AudioAdapterImpl.cpp

    r28800 r30934  
    246246    if (mData->mAudioDriver != aAudioDriver)
    247247    {
    248         /*
    249          * which audio driver type are we supposed to use?
    250          */
    251         switch (aAudioDriver)
     248        if (settings::MachineConfigFile::isAudioDriverAllowedOnThisHost(aAudioDriver))
    252249        {
    253             case AudioDriverType_Null:
    254 #ifdef RT_OS_WINDOWS
    255 # ifdef VBOX_WITH_WINMM
    256             case AudioDriverType_WinMM:
    257 # endif
    258             case AudioDriverType_DirectSound:
    259 #endif /* RT_OS_WINDOWS */
    260 #ifdef RT_OS_SOLARIS
    261             case AudioDriverType_SolAudio:
    262 #endif
    263 #ifdef RT_OS_LINUX
    264 # ifdef VBOX_WITH_ALSA
    265             case AudioDriverType_ALSA:
    266 # endif
    267 # ifdef VBOX_WITH_PULSE
    268             case AudioDriverType_Pulse:
    269 # endif
    270 #endif /* RT_OS_LINUX */
    271 #if defined (RT_OS_LINUX) || defined (RT_OS_FREEBSD) || defined(VBOX_WITH_SOLARIS_OSS)
    272             case AudioDriverType_OSS:
    273 #endif
    274 #ifdef RT_OS_FREEBSD
    275 # ifdef VBOX_WITH_PULSE
    276             case AudioDriverType_Pulse:
    277 # endif
    278 #endif
    279 #ifdef RT_OS_DARWIN
    280             case AudioDriverType_CoreAudio:
    281 #endif
    282 #ifdef RT_OS_OS2
    283             case AudioDriverType_MMPM:
    284 #endif
    285             {
    286                 mData.backup();
    287                 mData->mAudioDriver = aAudioDriver;
    288 
    289                 alock.release();
    290                 AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
    291                 mParent->setModified(Machine::IsModified_AudioAdapter);
    292                 break;
    293             }
    294 
    295             default:
    296             {
    297                 AssertMsgFailed (("Wrong audio driver type %d\n",
    298                                   aAudioDriver));
    299                 rc = E_FAIL;
    300             }
     250            mData.backup();
     251            mData->mAudioDriver = aAudioDriver;
     252
     253            alock.release();
     254            AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
     255            mParent->setModified(Machine::IsModified_AudioAdapter);
     256        }
     257        else
     258        {
     259            AssertMsgFailed(("Wrong audio driver type %d\n", aAudioDriver));
     260            rc = E_FAIL;
    301261        }
    302262    }
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