Changeset 82252 in vbox for trunk/src/VBox/Devices/Audio/HDACodec.cpp
- Timestamp:
- Nov 27, 2019 9:31:53 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/HDACodec.cpp
r81182 r82252 3127 3127 int hdaCodecLoadState(PHDACODEC pThis, PSSMHANDLE pSSM, uint32_t uVersion) 3128 3128 { 3129 int rc = VINF_SUCCESS;3130 3131 3129 PCSSMFIELD pFields = NULL; 3132 3130 uint32_t fFlags = 0; … … 3154 3152 int rc2 = SSMR3GetU32(pSSM, &cNodes); 3155 3153 AssertRCReturn(rc2, rc2); 3156 if (cNodes != 0x1c) 3157 return VERR_SSM_DATA_UNIT_FORMAT_CHANGED; 3154 AssertReturn(cNodes == 0x1c, VERR_SSM_DATA_UNIT_FORMAT_CHANGED); 3158 3155 AssertReturn(pThis->cTotalNodes == 0x1c, VERR_INTERNAL_ERROR); 3159 3156 … … 3164 3161 3165 3162 default: 3166 rc = VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 3167 break; 3168 } 3169 3170 if (RT_SUCCESS(rc)) 3171 { 3172 for (unsigned idxNode = 0; idxNode < pThis->cTotalNodes; ++idxNode) 3173 { 3174 uint8_t idOld = pThis->paNodes[idxNode].SavedState.Core.uID; 3175 int rc2 = SSMR3GetStructEx(pSSM, &pThis->paNodes[idxNode].SavedState, 3176 sizeof(pThis->paNodes[idxNode].SavedState), 3177 fFlags, pFields, NULL); 3178 if (RT_SUCCESS(rc)) 3179 rc = rc2; 3180 3181 if (RT_FAILURE(rc)) 3182 break; 3183 3184 AssertLogRelMsgReturn(idOld == pThis->paNodes[idxNode].SavedState.Core.uID, 3185 ("loaded %#x, expected %#x\n", pThis->paNodes[idxNode].SavedState.Core.uID, idOld), 3186 VERR_SSM_DATA_UNIT_FORMAT_CHANGED); 3187 } 3188 3189 if (RT_SUCCESS(rc)) 3190 { 3191 /* 3192 * Update stuff after changing the state. 3193 */ 3194 PCODECNODE pNode; 3195 if (hdaCodecIsDacNode(pThis, pThis->u8DacLineOut)) 3196 { 3197 pNode = &pThis->paNodes[pThis->u8DacLineOut]; 3198 hdaCodecToAudVolume(pThis, pNode, &pNode->dac.B_params, PDMAUDIOMIXERCTL_FRONT); 3199 } 3200 else if (hdaCodecIsSpdifOutNode(pThis, pThis->u8DacLineOut)) 3201 { 3202 pNode = &pThis->paNodes[pThis->u8DacLineOut]; 3203 hdaCodecToAudVolume(pThis, pNode, &pNode->spdifout.B_params, PDMAUDIOMIXERCTL_FRONT); 3204 } 3205 3206 pNode = &pThis->paNodes[pThis->u8AdcVolsLineIn]; 3207 hdaCodecToAudVolume(pThis, pNode, &pNode->adcvol.B_params, PDMAUDIOMIXERCTL_LINE_IN); 3208 } 3209 } 3210 3211 LogFlowFuncLeaveRC(rc); 3212 return rc; 3163 AssertFailedReturn(VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION); 3164 } 3165 3166 for (unsigned idxNode = 0; idxNode < pThis->cTotalNodes; ++idxNode) 3167 { 3168 uint8_t idOld = pThis->paNodes[idxNode].SavedState.Core.uID; 3169 int rc = SSMR3GetStructEx(pSSM, &pThis->paNodes[idxNode].SavedState, 3170 sizeof(pThis->paNodes[idxNode].SavedState), 3171 fFlags, pFields, NULL); 3172 AssertRCReturn(rc, rc); 3173 AssertLogRelMsgReturn(idOld == pThis->paNodes[idxNode].SavedState.Core.uID, 3174 ("loaded %#x, expected %#x\n", pThis->paNodes[idxNode].SavedState.Core.uID, idOld), 3175 VERR_SSM_DATA_UNIT_FORMAT_CHANGED); 3176 } 3177 3178 /* 3179 * Update stuff after changing the state. 3180 */ 3181 PCODECNODE pNode; 3182 if (hdaCodecIsDacNode(pThis, pThis->u8DacLineOut)) 3183 { 3184 pNode = &pThis->paNodes[pThis->u8DacLineOut]; 3185 hdaCodecToAudVolume(pThis, pNode, &pNode->dac.B_params, PDMAUDIOMIXERCTL_FRONT); 3186 } 3187 else if (hdaCodecIsSpdifOutNode(pThis, pThis->u8DacLineOut)) 3188 { 3189 pNode = &pThis->paNodes[pThis->u8DacLineOut]; 3190 hdaCodecToAudVolume(pThis, pNode, &pNode->spdifout.B_params, PDMAUDIOMIXERCTL_FRONT); 3191 } 3192 3193 pNode = &pThis->paNodes[pThis->u8AdcVolsLineIn]; 3194 hdaCodecToAudVolume(pThis, pNode, &pNode->adcvol.B_params, PDMAUDIOMIXERCTL_LINE_IN); 3195 3196 LogFlowFuncLeaveRC(VINF_SUCCESS); 3197 return VINF_SUCCESS; 3213 3198 } 3214 3199
Note:
See TracChangeset
for help on using the changeset viewer.