VirtualBox

Changeset 56662 in vbox


Ignore:
Timestamp:
Jun 26, 2015 4:31:12 PM (9 years ago)
Author:
vboxsync
Message:

Main: When changing audio controller, change codec as well.

File:
1 edited

Legend:

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

    r56516 r56662  
    323323    if (mData->m->mAudioController != aAudioController)
    324324    {
     325        AudioCodecType_T defaultCodec;
     326
    325327        /*
    326328         * which audio hardware type are we supposed to use?
     
    328330        switch (aAudioController)
    329331        {
     332            /* codec type needs to match the controller. */
    330333            case AudioControllerType_AC97:
     334                defaultCodec = AudioCodecType_STAC9700;
     335                break;
    331336            case AudioControllerType_SB16:
     337                defaultCodec = AudioCodecType_SB16;
     338                break;
    332339            case AudioControllerType_HDA:
    333             {
    334                 mData->m.backup();
    335                 mData->m->mAudioController = aAudioController;
    336                 alock.release();
    337                 AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
    338                 mParent->i_setModified(Machine::IsModified_AudioAdapter);
     340                defaultCodec = AudioCodecType_STAC9221;
    339341                break;
    340             }
    341342
    342343            default:
     
    345346                rc = E_FAIL;
    346347        }
     348        if (rc == S_OK)
     349        {
     350            mData->m.backup();
     351            mData->m->mAudioController = aAudioController;
     352            mData->m->mAudioCodec = defaultCodec;
     353            alock.release();
     354            AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
     355            mParent->i_setModified(Machine::IsModified_AudioAdapter);
     356        }
    347357    }
    348358
     
    370380
    371381    /*
    372      * which audio hardware type are we supposed to use?
     382     * ensure that the codec type matches the audio controller
    373383     */
    374384    switch (mData->m->mAudioController)
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