Changeset 94993 in vbox for trunk/include/VBox
- Timestamp:
- May 12, 2022 1:57:54 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmaudioinline.h
r93115 r94993 1150 1150 * @param pProps The PCM properties to check. 1151 1151 * 1152 * @remarks This just performs a generic check of value ranges. Further, it 1153 * will assert if the input is invalid. 1152 * @remarks This just performs a generic check of value ranges. 1154 1153 * 1155 1154 * @sa PDMAudioStrmCfgIsValid … … 1159 1158 AssertPtrReturn(pProps, false); 1160 1159 1161 AssertReturn(pProps->cChannelsX != 0, false); 1162 AssertReturn(pProps->cChannelsX <= PDMAUDIO_MAX_CHANNELS, false); 1163 AssertMsgReturn( pProps->cbSampleX == 1 || pProps->cbSampleX == 2 || pProps->cbSampleX == 4 || (pProps->cbSampleX == 8 && pProps->fRaw), 1164 ("%u\n", pProps->cbSampleX), false); 1165 AssertMsgReturn(pProps->cbFrame == pProps->cbSampleX * pProps->cChannelsX, 1166 ("cbFrame=%u cbSample=%u cChannels=%u\n", pProps->cbFrame, pProps->cbSampleX, pProps->cChannelsX), 1167 false); 1168 AssertMsgReturn(pProps->uHz >= 1000 && pProps->uHz < 1000000, ("%u\n", pProps->uHz), false); 1169 AssertMsgReturn(pProps->cShiftX == PDMAUDIOPCMPROPS_MAKE_SHIFT(pProps), 1170 ("cShift=%u cbSample=%u cChannels=%u\n", pProps->cShiftX, pProps->cbSampleX, pProps->cChannelsX), 1171 false); 1172 AssertReturn(!pProps->fRaw || (pProps->fSigned && pProps->cbSampleX == sizeof(int64_t)), false); 1173 return true; 1160 /* Channels. */ 1161 if ( pProps->cChannelsX != 0 1162 && pProps->cChannelsX <= PDMAUDIO_MAX_CHANNELS 1163 /* Sample size. */ 1164 && ( pProps->cbSampleX == 1 1165 || pProps->cbSampleX == 2 1166 || pProps->cbSampleX == 4 1167 || (pProps->cbSampleX == 8 && pProps->fRaw)) 1168 /* Hertz rate. */ 1169 && pProps->uHz >= 1000 1170 && pProps->uHz < 1000000 1171 /* Raw format: Here we only support int64_t as sample size currently, if enabled. */ 1172 && ( !pProps->fRaw 1173 || (pProps->fSigned && pProps->cbSampleX == sizeof(int64_t))) 1174 ) 1175 { 1176 /* A few more sanity checks to see if the structure has been properly initialized (via PDMAudioPropsInit[Ex]). */ 1177 AssertMsgReturn(pProps->cShiftX == PDMAUDIOPCMPROPS_MAKE_SHIFT(pProps), 1178 ("cShift=%u cbSample=%u cChannels=%u\n", pProps->cShiftX, pProps->cbSampleX, pProps->cChannelsX), 1179 false); 1180 AssertMsgReturn(pProps->cbFrame == pProps->cbSampleX * pProps->cChannelsX, 1181 ("cbFrame=%u cbSample=%u cChannels=%u\n", pProps->cbFrame, pProps->cbSampleX, pProps->cChannelsX), 1182 false); 1183 1184 return true; 1185 } 1186 1187 return false; 1174 1188 } 1175 1189
Note:
See TracChangeset
for help on using the changeset viewer.