VirtualBox

Changeset 68537 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Aug 28, 2017 1:50:35 PM (7 years ago)
Author:
vboxsync
Message:

xml/Settings.cpp: audio in/out enable, fix default handling to give backwards compatibility (everything enabled by default) and be paranoid for new VMs (everything disabled by default)
Main/AudioAdapter: since new VMs are created with old settings version, make sure that the paranoid defaults for audio in/out enable are applied

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

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

    r68485 r68537  
    8686    mData.allocate();
    8787    mData->driverType = defaultAudioDriver;
     88    mData->fEnabledIn = false;
     89    mData->fEnabledOut = false;
    8890
    8991    /* Confirm a successful initialization */
  • trunk/src/VBox/Main/xml/Settings.cpp

    r68485 r68537  
    25472547AudioAdapter::AudioAdapter() :
    25482548    fEnabled(true), // default for old VMs, for new ones it's false
    2549     fEnabledIn(true),
    2550     fEnabledOut(true),
     2549    fEnabledIn(true), // default for old VMs, for new ones it's false
     2550    fEnabledOut(true), // default for old VMs, for new ones it's false
    25512551    controllerType(AudioControllerType_AC97),
    25522552    codecType(AudioCodecType_STAC9700),
     
    25612561{
    25622562    return (sv < SettingsVersion_v1_16 ? false : !fEnabled)
    2563         && fEnabledIn == true
     2563        && (sv <= SettingsVersion_v1_16 ? fEnabledIn : !fEnabledIn)
     2564        && (sv <= SettingsVersion_v1_16 ? fEnabledOut : !fEnabledOut)
    25642565        && fEnabledOut == true
    25652566        && controllerType == AudioControllerType_AC97
     
    38253826        /* The new default is disabled, before it was enabled by default. */
    38263827        hw.audioAdapter.fEnabled = false;
     3828        /* The new default is disabled, before it was enabled by default. */
     3829        hw.audioAdapter.fEnabledIn = false;
     3830        /* The new default is disabled, before it was enabled by default. */
     3831        hw.audioAdapter.fEnabledOut = false;
    38273832    }
    38283833
     
    60396044            pelmAudio->setAttribute("enabled", hw.audioAdapter.fEnabled);
    60406045
    6041         if (!hw.audioAdapter.fEnabledIn)
     6046        if (   (m->sv <= SettingsVersion_v1_16 && !hw.audioAdapter.fEnabledIn)
     6047            || (m->sv > SettingsVersion_v1_16 && hw.audioAdapter.fEnabledIn))
    60426048            pelmAudio->setAttribute("enabledIn", hw.audioAdapter.fEnabledIn);
    60436049
    6044         if (!hw.audioAdapter.fEnabledOut)
     6050        if (   (m->sv <= SettingsVersion_v1_16 && !hw.audioAdapter.fEnabledOut)
     6051            || (m->sv > SettingsVersion_v1_16 && hw.audioAdapter.fEnabledOut))
    60456052            pelmAudio->setAttribute("enabledOut", hw.audioAdapter.fEnabledOut);
    60466053
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