Changeset 82458 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Dec 6, 2019 1:14:36 PM (5 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioMixer.cpp
r82406 r82458 1445 1445 RTStrPrintf(szName, sizeof(szName), "MixerSink-%s", pSink->pszName); 1446 1446 1447 char szFile[RTPATH_MAX + 1];1447 char szFile[RTPATH_MAX]; 1448 1448 rc2 = DrvAudioHlpFileNameGet(szFile, RT_ELEMENTS(szFile), szTemp, szName, 1449 1449 0 /* Instance */, PDMAUDIOFILETYPE_WAV, PDMAUDIOFILENAME_FLAGS_NONE); -
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r82255 r82458 2547 2547 pStream->cRefs = 1; 2548 2548 2549 char szFile[RTPATH_MAX]; 2549 2550 if (pCfgHost->enmDir == PDMAUDIODIR_IN) 2550 2551 { 2551 2552 if (pThis->In.Cfg.Dbg.fEnabled) 2552 2553 { 2553 char szFile[RTPATH_MAX + 1]; 2554 2555 int rc2 = DrvAudioHlpFileNameGet(szFile, RT_ELEMENTS(szFile), pThis->In.Cfg.Dbg.szPathOut, "CaptureNonInterleaved", 2554 int rc2 = DrvAudioHlpFileNameGet(szFile, sizeof(szFile), pThis->In.Cfg.Dbg.szPathOut, "CaptureNonInterleaved", 2556 2555 pThis->pDrvIns->iInstance, PDMAUDIOFILETYPE_WAV, PDMAUDIOFILENAME_FLAGS_NONE); 2557 2556 if (RT_SUCCESS(rc2)) … … 2566 2565 if (RT_SUCCESS(rc2)) 2567 2566 { 2568 rc2 = DrvAudioHlpFileNameGet(szFile, RT_ELEMENTS(szFile), pThis->In.Cfg.Dbg.szPathOut, "StreamRead",2567 rc2 = DrvAudioHlpFileNameGet(szFile, sizeof(szFile), pThis->In.Cfg.Dbg.szPathOut, "StreamRead", 2569 2568 pThis->pDrvIns->iInstance, PDMAUDIOFILETYPE_WAV, PDMAUDIOFILENAME_FLAGS_NONE); 2570 2569 if (RT_SUCCESS(rc2)) … … 2586 2585 if (pThis->Out.Cfg.Dbg.fEnabled) 2587 2586 { 2588 char szFile[RTPATH_MAX + 1]; 2589 2590 int rc2 = DrvAudioHlpFileNameGet(szFile, RT_ELEMENTS(szFile), pThis->Out.Cfg.Dbg.szPathOut, "PlayNonInterleaved", 2587 int rc2 = DrvAudioHlpFileNameGet(szFile, sizeof(szFile), pThis->Out.Cfg.Dbg.szPathOut, "PlayNonInterleaved", 2591 2588 pThis->pDrvIns->iInstance, PDMAUDIOFILETYPE_WAV, PDMAUDIOFILENAME_FLAGS_NONE); 2592 2589 if (RT_SUCCESS(rc2)) … … 2601 2598 if (RT_SUCCESS(rc2)) 2602 2599 { 2603 rc2 = DrvAudioHlpFileNameGet(szFile, RT_ELEMENTS(szFile), pThis->Out.Cfg.Dbg.szPathOut, "StreamWrite",2600 rc2 = DrvAudioHlpFileNameGet(szFile, sizeof(szFile), pThis->Out.Cfg.Dbg.szPathOut, "StreamWrite", 2604 2601 pThis->pDrvIns->iInstance, PDMAUDIOFILETYPE_WAV, PDMAUDIOFILENAME_FLAGS_NONE); 2605 2602 if (RT_SUCCESS(rc2)) -
trunk/src/VBox/Devices/Audio/DrvAudio.h
r82255 r82458 101 101 /** Where to store the debugging files. 102 102 * Defaults to VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH if not set. */ 103 char szPathOut[RTPATH_MAX + 1];103 char szPathOut[RTPATH_MAX]; 104 104 } Dbg; 105 105 } DRVAUDIOCFG, *PDRVAUDIOCFG; -
trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp
r82259 r82458 1520 1520 do 1521 1521 { 1522 char szFilePath[RTPATH_MAX + 1]; 1523 RTStrPrintf2(szFilePath, sizeof(szFilePath), "%s", pszPath); 1522 char szFilePath[RTPATH_MAX]; 1523 rc = RTStrCopy(szFilePath, sizeof(szFilePath), pszPath); 1524 AssertRCBreak(rc); 1524 1525 1525 1526 /* Create it when necessary. */ … … 1531 1532 } 1532 1533 1533 char szFileName[RTPATH_MAX + 1];1534 char szFileName[RTPATH_MAX]; 1534 1535 szFileName[0] = '\0'; 1535 1536 … … 1588 1589 break; 1589 1590 1590 RTStrPrintf2(pszFile, cchFile, "%s", szFilePath);1591 rc = RTStrCopy(pszFile, cchFile, szFilePath); 1591 1592 1592 1593 } while (0); -
trunk/src/VBox/Devices/Audio/DrvHostValidationKit.cpp
r82255 r82458 142 142 RT_NOREF(pDrv, pCfgAcq); 143 143 144 int rc = VINF_SUCCESS;145 146 144 pStreamDbg->tsStarted = 0; 147 145 pStreamDbg->uSamplesSinceStarted = 0; … … 149 147 pStreamDbg->Out.cbPlayBuffer = DrvAudioHlpFramesToBytes(pCfgReq->Backend.cFramesBufferSize, &pCfgReq->Props); 150 148 pStreamDbg->Out.pu8PlayBuffer = (uint8_t *)RTMemAlloc(pStreamDbg->Out.cbPlayBuffer); 151 if (!pStreamDbg->Out.pu8PlayBuffer) 152 rc = VERR_NO_MEMORY; 153 149 AssertReturn(pStreamDbg->Out.pu8PlayBuffer, VERR_NO_MEMORY); 150 151 char szTemp[RTPATH_MAX]; 152 int rc = RTPathTemp(szTemp, sizeof(szTemp)); 154 153 if (RT_SUCCESS(rc)) 155 {156 char szTemp[RTPATH_MAX];157 rc = RTPathTemp(szTemp, sizeof(szTemp));158 159 RTPathAppend(szTemp, sizeof(szTemp), "VBoxTestTmp\\VBoxAudioValKit");160 154 rc = RTPathAppend(szTemp, sizeof(szTemp), "VBoxTestTmp\\VBoxAudioValKit"); 155 if (RT_SUCCESS(rc)) 156 { 157 char szFile[RTPATH_MAX]; 158 rc = DrvAudioHlpFileNameGet(szFile, sizeof(szFile), szTemp, "VaKit", 159 0 /* Instance */, PDMAUDIOFILETYPE_WAV, PDMAUDIOFILENAME_FLAGS_NONE); 161 160 if (RT_SUCCESS(rc)) 162 161 { 163 char szFile[RTPATH_MAX + 1]; 164 165 rc = DrvAudioHlpFileNameGet(szFile, RT_ELEMENTS(szFile), szTemp, "VaKit", 166 0 /* Instance */, PDMAUDIOFILETYPE_WAV, PDMAUDIOFILENAME_FLAGS_NONE); 162 rc = DrvAudioHlpFileCreate(PDMAUDIOFILETYPE_WAV, szFile, PDMAUDIOFILE_FLAGS_NONE, &pStreamDbg->pFile); 167 163 if (RT_SUCCESS(rc)) 168 { 169 rc = DrvAudioHlpFileCreate(PDMAUDIOFILETYPE_WAV, szFile, PDMAUDIOFILE_FLAGS_NONE, &pStreamDbg->pFile); 170 if (RT_SUCCESS(rc)) 171 rc = DrvAudioHlpFileOpen(pStreamDbg->pFile, PDMAUDIOFILE_DEFAULT_OPEN_FLAGS, &pCfgReq->Props); 172 } 173 174 if (RT_FAILURE(rc)) 175 { 176 LogRel(("VaKitAudio: Creating output file '%s' failed with %Rrc\n", szFile, rc)); 177 } 178 else 179 { 180 size_t cch; 181 char szTimingInfo[128]; 182 cch = RTStrPrintf(szTimingInfo, sizeof(szTimingInfo), "# %uHz %uch %ubit\n", 183 pCfgReq->Props.uHz, pCfgReq->Props.cChannels, pCfgReq->Props.cbSample * 8); 184 185 RTFileWrite(pStreamDbg->hFileTiming, szTimingInfo, cch, NULL); 186 } 164 rc = DrvAudioHlpFileOpen(pStreamDbg->pFile, PDMAUDIOFILE_DEFAULT_OPEN_FLAGS, &pCfgReq->Props); 187 165 } 166 167 if (RT_FAILURE(rc)) 168 LogRel(("VaKitAudio: Creating output file '%s' failed with %Rrc\n", szFile, rc)); 188 169 else 189 LogRel(("VaKitAudio: Unable to retrieve temp dir: %Rrc\n", rc)); 190 } 191 170 { 171 size_t cch; 172 char szTimingInfo[128]; 173 cch = RTStrPrintf(szTimingInfo, sizeof(szTimingInfo), "# %uHz %uch %ubit\n", 174 pCfgReq->Props.uHz, pCfgReq->Props.cChannels, pCfgReq->Props.cbSample * 8); 175 176 RTFileWrite(pStreamDbg->hFileTiming, szTimingInfo, cch, NULL); 177 } 178 } 179 else 180 LogRel(("VaKitAudio: Unable to retrieve temp dir: %Rrc\n", rc)); 192 181 return rc; 193 182 }
Note:
See TracChangeset
for help on using the changeset viewer.