Changeset 86494 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Oct 8, 2020 11:23:03 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r82987 r86494 817 817 if (RT_SUCCESS(rc)) 818 818 { 819 rc = drvAudioStreamCreateInternalBackend(pThis, pStream, &pStream->Host.Cfg, NULL /* pCfgAcq */); 819 PDMAUDIOSTREAMCFG CfgHostAcq; 820 rc = drvAudioStreamCreateInternalBackend(pThis, pStream, &pStream->Host.Cfg, &CfgHostAcq); 820 821 /** @todo Validate (re-)acquired configuration with pStream->Host.Cfg? */ 822 if (RT_SUCCESS(rc)) 823 { 824 #ifdef LOG_ENABLED 825 LogFunc(("[%s] Acquired host format:\n", pStream->szName)); 826 DrvAudioHlpStreamCfgPrint(&CfgHostAcq); 827 #endif 828 } 821 829 } 822 830 } … … 1113 1121 1114 1122 /** 1123 * Re-initializes the given stream if it is scheduled for this operation. 1124 * 1125 * @returns VBox status code. 1126 * @param pThis Pointer to driver instance. 1127 * @param pStream Stream to check and maybe re-initialize. 1128 */ 1129 static int drvAudioStreamMaybeReInit(PDRVAUDIO pThis, PPDMAUDIOSTREAM pStream) 1130 { 1131 int rc = VINF_SUCCESS; 1132 1133 if (pStream->fStatus & PDMAUDIOSTREAMSTS_FLAGS_PENDING_REINIT) 1134 { 1135 #ifdef VBOX_WITH_AUDIO_ENUM 1136 if (pThis->fEnumerateDevices) 1137 { 1138 /* Re-enumerate all host devices. */ 1139 drvAudioDevicesEnumerateInternal(pThis, true /* fLog */, NULL /* pDevEnum */); 1140 1141 pThis->fEnumerateDevices = false; 1142 } 1143 #endif /* VBOX_WITH_AUDIO_ENUM */ 1144 1145 /* Remove the pending re-init flag in any case, regardless whether the actual re-initialization succeeded 1146 * or not. If it failed, the backend needs to notify us again to try again at some later point in time. */ 1147 pStream->fStatus &= ~PDMAUDIOSTREAMSTS_FLAGS_PENDING_REINIT; 1148 rc = drvAudioStreamReInitInternal(pThis, pStream); 1149 } 1150 1151 return rc; 1152 } 1153 1154 /** 1115 1155 * Does one iteration of an audio stream. 1116 1156 * This function gives the backend the chance of iterating / altering data and … … 1131 1171 return VINF_SUCCESS; 1132 1172 1133 int rc;1134 1135 1173 /* Is the stream scheduled for re-initialization? Do so now. */ 1136 if (pStream->fStatus & PDMAUDIOSTREAMSTS_FLAGS_PENDING_REINIT) 1137 { 1138 #ifdef VBOX_WITH_AUDIO_ENUM 1139 if (pThis->fEnumerateDevices) 1140 { 1141 /* Re-enumerate all host devices. */ 1142 drvAudioDevicesEnumerateInternal(pThis, true /* fLog */, NULL /* pDevEnum */); 1143 1144 pThis->fEnumerateDevices = false; 1145 } 1146 #endif /* VBOX_WITH_AUDIO_ENUM */ 1147 1148 /* Remove the pending re-init flag in any case, regardless whether the actual re-initialization succeeded 1149 * or not. If it failed, the backend needs to notify us again to try again at some later point in time. */ 1150 pStream->fStatus &= ~PDMAUDIOSTREAMSTS_FLAGS_PENDING_REINIT; 1151 1152 rc = drvAudioStreamReInitInternal(pThis, pStream); 1153 if (RT_FAILURE(rc)) 1154 return rc; 1155 } 1174 int rc = drvAudioStreamMaybeReInit(pThis, pStream); 1175 if (RT_FAILURE(rc)) 1176 return rc; 1156 1177 1157 1178 #ifdef LOG_ENABLED … … 2893 2914 int rc2 = RTCritSectEnter(&pThis->CritSect); 2894 2915 AssertRC(rc2); 2916 2917 /* Is the stream scheduled for re-initialization? Do so now. */ 2918 int rc = drvAudioStreamMaybeReInit(pThis, pStream); 2919 if (RT_FAILURE(rc)) /** @todo r=aeichner What is the correct operation in the failure case? */ 2920 LogRel(("Audio: Reinitializing the stream in drvAudioStreamGetStatus() failed with %Rrc\n", rc)); 2895 2921 2896 2922 PDMAUDIOSTREAMSTS fStrmStatus = pStream->fStatus;
Note:
See TracChangeset
for help on using the changeset viewer.