Changeset 63629 in vbox
- Timestamp:
- Aug 24, 2016 2:33:27 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 110352
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostDebugAudio.cpp
r63534 r63629 167 167 if (RT_SUCCESS(rc)) 168 168 { 169 char sz File[RTPATH_MAX];170 rc = DrvAudioHlpGetFileName(szFile, RT_ELEMENTS(szFile), "/tmp/", NULL, PDMAUDIOFILETYPE_WAV);169 char szTemp[RTPATH_MAX]; 170 rc = RTPathTemp(szTemp, sizeof(szTemp)); 171 171 if (RT_SUCCESS(rc)) 172 172 { 173 LogRel(("DebugAudio: Creating output file '%s'\n", szFile)); 174 rc = DrvAudioHlpWAVFileOpen(&pDbgStream->File, szFile, 175 RTFILE_O_WRITE | RTFILE_O_DENY_WRITE | RTFILE_O_CREATE_REPLACE, 176 &Props, PDMAUDIOFILEFLAG_NONE); 177 if (RT_FAILURE(rc)) 178 LogRel(("DebugAudio: Creating output file '%s' failed with %Rrc\n", szFile, rc)); 173 char szFile[RTPATH_MAX]; 174 rc = DrvAudioHlpGetFileName(szFile, RT_ELEMENTS(szFile), szTemp, NULL, PDMAUDIOFILETYPE_WAV); 175 if (RT_SUCCESS(rc)) 176 { 177 LogFlowFunc(("%s\n", szFile)); 178 rc = DrvAudioHlpWAVFileOpen(&pDbgStream->File, szFile, 179 RTFILE_O_WRITE | RTFILE_O_DENY_WRITE | RTFILE_O_CREATE_REPLACE, 180 &Props, PDMAUDIOFILEFLAG_NONE); 181 if (RT_FAILURE(rc)) 182 LogRel(("DebugAudio: Creating output file '%s' failed with %Rrc\n", szFile, rc)); 183 } 184 else 185 LogRel(("DebugAudio: Unable to build file name for temp dir '%s': %Rrc\n", szTemp, rc)); 179 186 } 187 else 188 LogRel(("DebugAudio: Unable to retrieve temp dir: %Rrc\n", rc)); 180 189 } 181 190 … … 327 336 { 328 337 /* Delete the file again if nothing but the header was written to it. */ 329 if (!cbDataSize) 330 rc = RTFileDelete(pDbgStream->File.szName); /** @todo Make deletion configurable? */ 338 bool fDeleteEmptyFiles = true; /** @todo Make deletion configurable? */ 339 340 if ( !cbDataSize 341 && fDeleteEmptyFiles) 342 { 343 rc = RTFileDelete(pDbgStream->File.szName); 344 } 345 else 346 LogRel(("DebugAudio: Created output file '%s' (%zu bytes)\n", pDbgStream->File.szName, cbDataSize)); 331 347 } 332 348
Note:
See TracChangeset
for help on using the changeset viewer.