Changeset 87861 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Feb 24, 2021 3:04:02 PM (4 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioMixer.cpp
r87857 r87861 1510 1510 DrvAudioHlpFileClose(pSink->Dbg.pFile); 1511 1511 1512 char szTemp[RTPATH_MAX]; 1513 int rc2 = RTPathTemp(szTemp, sizeof(szTemp)); 1512 char szName[64]; 1513 RTStrPrintf(szName, sizeof(szName), "MixerSink-%s", pSink->pszName); 1514 1515 char szFile[RTPATH_MAX]; 1516 int rc2 = DrvAudioHlpFileNameGet(szFile, RT_ELEMENTS(szFile), NULL /* Use temporary directory */, szName, 1517 0 /* Instance */, PDMAUDIOFILETYPE_WAV, PDMAUDIOFILENAME_FLAGS_NONE); 1514 1518 if (RT_SUCCESS(rc2)) 1515 1519 { 1516 /** @todo Sanitize sink name. */ 1517 1518 char szName[64]; 1519 RTStrPrintf(szName, sizeof(szName), "MixerSink-%s", pSink->pszName); 1520 1521 char szFile[RTPATH_MAX]; 1522 rc2 = DrvAudioHlpFileNameGet(szFile, RT_ELEMENTS(szFile), szTemp, szName, 1523 0 /* Instance */, PDMAUDIOFILETYPE_WAV, PDMAUDIOFILENAME_FLAGS_NONE); 1520 rc2 = DrvAudioHlpFileCreate(PDMAUDIOFILETYPE_WAV, szFile, PDMAUDIOFILE_FLAGS_NONE, 1521 &pSink->Dbg.pFile); 1524 1522 if (RT_SUCCESS(rc2)) 1525 { 1526 rc2 = DrvAudioHlpFileCreate(PDMAUDIOFILETYPE_WAV, szFile, PDMAUDIOFILE_FLAGS_NONE, 1527 &pSink->Dbg.pFile); 1528 if (RT_SUCCESS(rc2)) 1529 rc2 = DrvAudioHlpFileOpen(pSink->Dbg.pFile, PDMAUDIOFILE_DEFAULT_OPEN_FLAGS, &pSink->PCMProps); 1530 } 1523 rc2 = DrvAudioHlpFileOpen(pSink->Dbg.pFile, PDMAUDIOFILE_DEFAULT_OPEN_FLAGS, &pSink->PCMProps); 1531 1524 } 1532 1525 } -
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r87852 r87861 2934 2934 # endif 2935 2935 2936 # ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA 2936 2937 if (pThis->fDebugEnabled) 2937 2938 { … … 2942 2943 RTFileClose(fh); 2943 2944 } 2945 # endif 2944 2946 2945 2947 # ifdef HDA_USE_DMA_ACCESS_HANDLER_WRITING … … 4823 4825 N_("HDA configuration error: failed to read debugging enabled flag as boolean")); 4824 4826 4825 rc = pHlp->pfnCFGMQueryStringAllocDef(pCfg, "DebugPathOut", &pThisCC->Dbg.pszOutPath, VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH);4827 rc = pHlp->pfnCFGMQueryStringAllocDef(pCfg, "DebugPathOut", &pThisCC->Dbg.pszOutPath, NULL); 4826 4828 if (RT_FAILURE(rc)) 4827 4829 return PDMDEV_SET_ERROR(pDevIns, rc, -
trunk/src/VBox/Devices/Audio/DevHDA.h
r87836 r87861 271 271 bool fEnabled; 272 272 /** Path where to dump the debug output to. 273 * Defaults to VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH. */273 * Can be NULL, in which the system's temporary directory will be used then. */ 274 274 R3PTRTYPE(char *) pszOutPath; 275 275 } Dbg; -
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r87852 r87861 525 525 bool afAlignment[7]; 526 526 /** Path where to dump the debug output to. 527 * Defaults to VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH. */527 * Can be NULL, in which the system's temporary directory will be used then. */ 528 528 R3PTRTYPE(char *) pszOutPath; 529 529 } AC97STATEDEBUG; … … 4177 4177 N_("AC97 configuration error: failed to read debugging enabled flag as boolean")); 4178 4178 4179 rc = pHlp->pfnCFGMQueryStringAllocDef(pCfg, "DebugPathOut", &pThisCC->Dbg.pszOutPath, VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH);4179 rc = pHlp->pfnCFGMQueryStringAllocDef(pCfg, "DebugPathOut", &pThisCC->Dbg.pszOutPath, NULL); 4180 4180 if (RT_FAILURE(rc)) 4181 4181 return PDMDEV_SET_ERROR(pDevIns, rc, -
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r87854 r87861 2327 2327 || !strlen(pCfg->Dbg.szPathOut)) 2328 2328 { 2329 RTStrPrintf(pCfg->Dbg.szPathOut, sizeof(pCfg->Dbg.szPathOut), VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH); 2329 rc2 = RTPathTemp(pCfg->Dbg.szPathOut, sizeof(pCfg->Dbg.szPathOut)); 2330 if (RT_FAILURE(rc2)) 2331 LogRel(("Audio: Error retrieving temporary directory, rc=%Rrc\n", rc2)); 2330 2332 } 2331 2333 -
trunk/src/VBox/Devices/Audio/DrvAudio.h
r87438 r87861 109 109 /** Whether audio debugging is enabled or not. */ 110 110 bool fEnabled; 111 /** Where to store the debugging files. 112 * Defaults to VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH if not set. */ 111 /** Where to store the debugging files. */ 113 112 char szPathOut[RTPATH_MAX]; 114 113 } Dbg; -
trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp
r87438 r87861 1502 1502 * @param cchFile Size (in characters) of the file name buffer. 1503 1503 * @param pszPath Base path to use. 1504 * If NULL or empty, the system's temporary directory will be used. 1504 1505 * @param pszName A name for better identifying the file. 1505 1506 * @param uInstance Device / driver instance which is using this file. … … 1512 1513 AssertPtrReturn(pszFile, VERR_INVALID_POINTER); 1513 1514 AssertReturn(cchFile, VERR_INVALID_PARAMETER); 1514 AssertPtrReturn(pszPath, VERR_INVALID_POINTER);1515 /* pszPath can be NULL. */ 1515 1516 AssertPtrReturn(pszName, VERR_INVALID_POINTER); 1516 1517 /** @todo Validate fFlags. */ … … 1518 1519 int rc; 1519 1520 1521 char *pszPathTmp = NULL; 1522 1520 1523 do 1521 1524 { 1525 if ( pszPath == NULL 1526 || !strlen(pszPath)) 1527 { 1528 char szTemp[RTPATH_MAX]; 1529 rc = RTPathTemp(szTemp, sizeof(szTemp)); 1530 if (RT_SUCCESS(rc)) 1531 { 1532 pszPathTmp = RTStrDup(szTemp); 1533 } 1534 else 1535 break; 1536 } 1537 else 1538 pszPathTmp = RTStrDup(pszPath); 1539 1540 AssertPtrBreakStmt(pszPathTmp, rc = VERR_NO_MEMORY); 1541 1522 1542 char szFilePath[RTPATH_MAX]; 1523 rc = RTStrCopy(szFilePath, sizeof(szFilePath), pszPath );1543 rc = RTStrCopy(szFilePath, sizeof(szFilePath), pszPathTmp); 1524 1544 AssertRCBreak(rc); 1525 1545 … … 1592 1612 1593 1613 } while (0); 1614 1615 RTStrFree(pszPathTmp); 1594 1616 1595 1617 LogFlowFuncLeaveRC(rc); -
trunk/src/VBox/Devices/Audio/DrvHostDebugAudio.cpp
r87853 r87861 134 134 static int debugCreateFile(PDRVHOSTDEBUGAUDIO pDrv, PDEBUGAUDIOSTREAM pStreamDbg, bool fIn, PPDMAUDIOSTREAMCFG pCfg) 135 135 { 136 char szTemp[RTPATH_MAX]; 137 int rc = RTPathTemp(szTemp, sizeof(szTemp)); 136 char szFile[RTPATH_MAX]; 137 int rc = DrvAudioHlpFileNameGet(szFile, RT_ELEMENTS(szFile), NULL /* Use temporary directory */, fIn ? "DebugAudioIn" : "DebugAudioOut", 138 pDrv->pDrvIns->iInstance, PDMAUDIOFILETYPE_WAV, PDMAUDIOFILENAME_FLAGS_NONE); 138 139 if (RT_SUCCESS(rc)) 139 140 { 140 char szFile[RTPATH_MAX]; 141 rc = DrvAudioHlpFileNameGet(szFile, RT_ELEMENTS(szFile), szTemp, fIn ? "DebugAudioIn" : "DebugAudioOut", 142 pDrv->pDrvIns->iInstance, PDMAUDIOFILETYPE_WAV, PDMAUDIOFILENAME_FLAGS_NONE); 141 rc = DrvAudioHlpFileCreate(PDMAUDIOFILETYPE_WAV, szFile, PDMAUDIOFILE_FLAGS_NONE, &pStreamDbg->pFile); 143 142 if (RT_SUCCESS(rc)) 144 143 { 145 rc = DrvAudioHlpFileCreate(PDMAUDIOFILETYPE_WAV, szFile, PDMAUDIOFILE_FLAGS_NONE, &pStreamDbg->pFile); 146 if (RT_SUCCESS(rc)) 147 { 148 rc = DrvAudioHlpFileOpen(pStreamDbg->pFile, RTFILE_O_WRITE | RTFILE_O_DENY_WRITE | RTFILE_O_CREATE_REPLACE, 149 &pCfg->Props); 150 } 151 152 if (RT_FAILURE(rc)) 153 LogRel(("DebugAudio: Creating %sput file '%s' failed with %Rrc\n", fIn ? "in" : "out", szFile, rc)); 144 rc = DrvAudioHlpFileOpen(pStreamDbg->pFile, RTFILE_O_WRITE | RTFILE_O_DENY_WRITE | RTFILE_O_CREATE_REPLACE, 145 &pCfg->Props); 154 146 } 155 else 156 LogRel(("DebugAudio: Unable to build file name for temp dir '%s': %Rrc\n", szTemp, rc)); 147 148 if (RT_FAILURE(rc)) 149 LogRel(("DebugAudio: Creating %sput file '%s' failed with %Rrc\n", fIn ? "in" : "out", szFile, rc)); 157 150 } 158 151 else 159 LogRel(("DebugAudio: Unable to retrieve temp dir: %Rrc\n", rc));152 LogRel(("DebugAudio: Unable to build file name: %Rrc\n", rc)); 160 153 161 154 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.