VirtualBox

Changeset 90012 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Jul 4, 2021 9:08:37 PM (3 years ago)
Author:
vboxsync
Message:

Audio: Output multichannel capable wave files. Simplify the code a little, removing AudioHlpFileGetDataSize among other things. Dropped the unused flags parameter for AudioHlpFileWrite. bugref:9890

Location:
trunk/src/VBox/Devices/Audio
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/AudioHlp.cpp

    r90011 r90012  
    2929#include <iprt/string.h>
    3030#include <iprt/uuid.h>
     31#include <iprt/formats/riff.h>
    3132
    3233#define LOG_GROUP LOG_GROUP_DRV_AUDIO
     
    4950*   Structures and Typedefs                                                                                                      *
    5051*********************************************************************************************************************************/
    51 /**
    52  * Structure for building up a .WAV file header.
    53  */
    54 typedef struct AUDIOWAVFILEHDR
    55 {
    56     uint32_t u32RIFF;
    57     uint32_t u32Size;
    58     uint32_t u32WAVE;
    59 
    60     uint32_t u32Fmt;
    61     uint32_t u32Size1;
    62     uint16_t u16AudioFormat;
    63     uint16_t u16NumChannels;
    64     uint32_t u32SampleRate;
    65     uint32_t u32ByteRate;
    66     uint16_t u16BlockAlign;
    67     uint16_t u16BitsPerSample;
    68 
    69     uint32_t u32ID2;
    70     uint32_t u32Size2;
    71 } AUDIOWAVFILEHDR, *PAUDIOWAVFILEHDR;
    72 AssertCompileSize(AUDIOWAVFILEHDR, 11*4);
    73 
    74 /**
    75  * Structure for keeeping the internal .WAV file data
    76  */
    77 typedef struct AUDIOWAVFILEDATA
    78 {
    79     /** The file header/footer. */
    80     AUDIOWAVFILEHDR Hdr;
    81 } AUDIOWAVFILEDATA, *PAUDIOWAVFILEDATA;
    82 
     52typedef struct AUDIOWAVEFILEHDR
     53{
     54    RTRIFFHDR               Hdr;
     55    RTRIFFWAVEFMTEXTCHUNK   FmtExt;
     56    RTRIFFCHUNK             Data;
     57} AUDIOWAVEFILEHDR;
    8358
    8459
     
    346321    AssertPtrReturn(pFile, VERR_NO_MEMORY);
    347322
    348     pFile->enmType = enmType;
    349     pFile->fFlags  = fFlags;
    350     pFile->hFile   = NIL_RTFILE;
    351     pFile->pvData  = NULL;
    352     pFile->cbData  = 0;
     323    pFile->enmType      = enmType;
     324    pFile->fFlags       = fFlags;
     325    pFile->cbWaveData   = 0;
     326    pFile->hFile        = NIL_RTFILE;
    353327    memcpy(pFile->szName, pszPath, cbPath);
    354328
     
    405379void AudioHlpFileDestroy(PAUDIOHLPFILE pFile)
    406380{
    407     if (!pFile)
    408         return;
    409 
    410     AudioHlpFileClose(pFile);
    411 
    412     RTMemFree(pFile);
    413     pFile = NULL;
     381    if (pFile)
     382    {
     383        AudioHlpFileClose(pFile);
     384        RTMemFree(pFile);
     385    }
    414386}
    415387
     
    424396 * @param   pProps              PCM properties to use.
    425397 */
    426 int AudioHlpFileOpen(PAUDIOHLPFILE pFile, uint32_t fOpen, PCPDMAUDIOPCMPROPS pProps)
    427 {
     398int AudioHlpFileOpen(PAUDIOHLPFILE pFile, uint64_t fOpen, PCPDMAUDIOPCMPROPS pProps)
     399{
     400    int rc;
     401
    428402    AssertPtrReturn(pFile,   VERR_INVALID_POINTER);
    429403    /** @todo Validate fOpen flags. */
     
    431405    Assert(PDMAudioPropsAreValid(pProps));
    432406
    433     int rc;
    434 
     407    /*
     408     * Raw files just needs to be opened.
     409     */
    435410    if (pFile->enmType == AUDIOHLPFILETYPE_RAW)
    436411        rc = RTFileOpen(&pFile->hFile, pFile->szName, fOpen);
     412    /*
     413     * Wave files needs a header to be constructed and we need to take note of where
     414     * there are sizes to update later when closing the file.
     415     */
    437416    else if (pFile->enmType == AUDIOHLPFILETYPE_WAV)
    438417    {
    439         pFile->pvData = (PAUDIOWAVFILEDATA)RTMemAllocZ(sizeof(AUDIOWAVFILEDATA));
    440         if (pFile->pvData)
     418        /* Construct the header. */
     419        AUDIOWAVEFILEHDR FileHdr;
     420        FileHdr.Hdr.uMagic                      = RTRIFFHDR_MAGIC;
     421        FileHdr.Hdr.cbFile                      = 0; /* need to update this later */
     422        FileHdr.Hdr.uFileType                   = RTRIFF_FILE_TYPE_WAVE;
     423        FileHdr.FmtExt.Chunk.uMagic             = RTRIFFWAVEFMT_MAGIC;
     424        FileHdr.FmtExt.Chunk.cbChunk            = sizeof(RTRIFFWAVEFMTEXTCHUNK) - sizeof(RTRIFFCHUNK);
     425        FileHdr.FmtExt.Data.Core.uFormatTag     = RTRIFFWAVEFMT_TAG_EXTENSIBLE;
     426        FileHdr.FmtExt.Data.Core.cChannels      = PDMAudioPropsChannels(pProps);
     427        FileHdr.FmtExt.Data.Core.uHz            = PDMAudioPropsHz(pProps);
     428        FileHdr.FmtExt.Data.Core.cbRate         = PDMAudioPropsFramesToBytes(pProps, PDMAudioPropsHz(pProps));
     429        FileHdr.FmtExt.Data.Core.cbFrame        = PDMAudioPropsFrameSize(pProps);
     430        FileHdr.FmtExt.Data.Core.cBitsPerSample = PDMAudioPropsSampleBits(pProps);
     431        FileHdr.FmtExt.Data.cbExtra             = sizeof(FileHdr.FmtExt.Data) - sizeof(FileHdr.FmtExt.Data.Core);
     432        FileHdr.FmtExt.Data.cValidBitsPerSample = PDMAudioPropsSampleBits(pProps);
     433        FileHdr.FmtExt.Data.fChannelMask        = 0;
     434        for (uintptr_t idxCh = 0; idxCh < FileHdr.FmtExt.Data.Core.cChannels; idxCh++)
    441435        {
    442             pFile->cbData = sizeof(PAUDIOWAVFILEDATA);
    443 
    444             PAUDIOWAVFILEDATA pData = (PAUDIOWAVFILEDATA)pFile->pvData;
    445             AssertPtr(pData);
    446 
    447             /* Header. */
    448             pData->Hdr.u32RIFF          = AUDIO_MAKE_FOURCC('R','I','F','F');
    449             pData->Hdr.u32Size          = 36;
    450             pData->Hdr.u32WAVE          = AUDIO_MAKE_FOURCC('W','A','V','E');
    451 
    452             pData->Hdr.u32Fmt           = AUDIO_MAKE_FOURCC('f','m','t',' ');
    453             pData->Hdr.u32Size1         = 16; /* Means PCM. */
    454             pData->Hdr.u16AudioFormat   = 1;  /* PCM, linear quantization. */
    455             pData->Hdr.u16NumChannels   = PDMAudioPropsChannels(pProps);
    456             pData->Hdr.u32SampleRate    = pProps->uHz;
    457             pData->Hdr.u32ByteRate      = PDMAudioPropsGetBitrate(pProps) / 8;
    458             pData->Hdr.u16BlockAlign    = PDMAudioPropsFrameSize(pProps);
    459             pData->Hdr.u16BitsPerSample = PDMAudioPropsSampleBits(pProps);
    460 
    461             /* Data chunk. */
    462             pData->Hdr.u32ID2           = AUDIO_MAKE_FOURCC('d','a','t','a');
    463             pData->Hdr.u32Size2         = 0;
    464 
    465             rc = RTFileOpen(&pFile->hFile, pFile->szName, fOpen);
    466             if (RT_SUCCESS(rc))
    467             {
    468                 rc = RTFileWrite(pFile->hFile, &pData->Hdr, sizeof(pData->Hdr), NULL);
    469                 if (RT_FAILURE(rc))
    470                 {
    471                     RTFileClose(pFile->hFile);
    472                     pFile->hFile = NIL_RTFILE;
    473                 }
    474             }
    475 
     436            PDMAUDIOCHANNELID const idCh = (PDMAUDIOCHANNELID)pProps->aidChannels[idxCh];
     437            AssertLogRelMsgReturn(idCh >= PDMAUDIOCHANNELID_FIRST_STANDARD && idCh < PDMAUDIOCHANNELID_END_STANDARD,
     438                                  ("Invalid channel ID %d for channel #%u", idCh, idxCh), VERR_INVALID_PARAMETER);
     439            AssertLogRelMsgReturn(!(FileHdr.FmtExt.Data.fChannelMask & RT_BIT_32(idCh - PDMAUDIOCHANNELID_FIRST_STANDARD)),
     440                                  ("Channel #%u repeats channel ID %d", idxCh, idCh), VERR_INVALID_PARAMETER);
     441            FileHdr.FmtExt.Data.fChannelMask |= RT_BIT_32(idCh - PDMAUDIOCHANNELID_FIRST_STANDARD);
     442        }
     443
     444        RTUUID UuidTmp;
     445        rc = RTUuidFromStr(&UuidTmp, RTRIFFWAVEFMTEXT_SUBTYPE_PCM);
     446        AssertRCReturn(rc, rc);
     447        FileHdr.FmtExt.Data.SubFormat = UuidTmp; /* (64-bit field maybe unaligned) */
     448
     449        FileHdr.Data.uMagic  = RTRIFFWAVEDATACHUNK_MAGIC;
     450        FileHdr.Data.cbChunk = 0; /* need to update this later */
     451
     452        /* Open the file and write out the header. */
     453        rc = RTFileOpen(&pFile->hFile, pFile->szName, fOpen);
     454        if (RT_SUCCESS(rc))
     455        {
     456            rc = RTFileWrite(pFile->hFile, &FileHdr, sizeof(FileHdr), NULL);
    476457            if (RT_FAILURE(rc))
    477458            {
    478                 RTMemFree(pFile->pvData);
    479                 pFile->pvData = NULL;
    480                 pFile->cbData = 0;
     459                RTFileClose(pFile->hFile);
     460                pFile->hFile = NIL_RTFILE;
    481461            }
    482462        }
    483         else
    484             rc = VERR_NO_MEMORY;
    485463    }
    486464    else
    487         rc = VERR_INVALID_PARAMETER;
    488 
     465        AssertFailedStmt(rc = VERR_INTERNAL_ERROR_3);
    489466    if (RT_SUCCESS(rc))
     467    {
     468        pFile->cbWaveData = 0;
    490469        LogRel2(("Audio: Opened file '%s'\n", pFile->szName));
     470    }
    491471    else
    492         LogRel(("Audio: Failed opening file '%s', rc=%Rrc\n", pFile->szName, rc));
    493 
     472        LogRel(("Audio: Failed opening file '%s': %Rrc\n", pFile->szName, rc));
    494473    return rc;
    495474}
     
    574553int AudioHlpFileClose(PAUDIOHLPFILE pFile)
    575554{
    576     if (!pFile)
     555    if (!pFile || pFile->hFile == NIL_RTFILE)
    577556        return VINF_SUCCESS;
    578557
    579     size_t cbSize = AudioHlpFileGetDataSize(pFile);
    580 
    581     int rc = VINF_SUCCESS;
    582 
    583     if (pFile->enmType == AUDIOHLPFILETYPE_RAW)
    584     {
    585         if (RTFileIsValid(pFile->hFile))
    586             rc = RTFileClose(pFile->hFile);
    587     }
    588     else if (pFile->enmType == AUDIOHLPFILETYPE_WAV)
    589     {
    590         if (RTFileIsValid(pFile->hFile))
    591         {
    592             PAUDIOWAVFILEDATA pData = (PAUDIOWAVFILEDATA)pFile->pvData;
    593             if (pData) /* The .WAV file data only is valid when a file actually has been created. */
    594             {
    595                 /* Update the header with the current data size. */
    596                 RTFileWriteAt(pFile->hFile, 0, &pData->Hdr, sizeof(pData->Hdr), NULL);
    597             }
    598 
    599             rc = RTFileClose(pFile->hFile);
    600         }
    601 
    602         if (pFile->pvData)
    603         {
    604             RTMemFree(pFile->pvData);
    605             pFile->pvData = NULL;
    606         }
    607     }
     558    /*
     559     * Wave files needs to update the data size and file size in the header.
     560     */
     561    if (pFile->enmType == AUDIOHLPFILETYPE_WAV)
     562    {
     563        uint32_t const cbFile = sizeof(AUDIOWAVEFILEHDR) - sizeof(RTRIFFCHUNK) + (uint32_t)pFile->cbWaveData;
     564        uint32_t const cbData = (uint32_t)pFile->cbWaveData;
     565
     566        int rc2;
     567        rc2 = RTFileWriteAt(pFile->hFile, RT_UOFFSETOF(AUDIOWAVEFILEHDR, Hdr.cbFile),   &cbFile, sizeof(cbFile), NULL);
     568        AssertRC(rc2);
     569        rc2 = RTFileWriteAt(pFile->hFile, RT_UOFFSETOF(AUDIOWAVEFILEHDR, Data.cbChunk), &cbData, sizeof(cbData), NULL);
     570        AssertRC(rc2);
     571    }
     572
     573    /*
     574     * Do the closing.
     575     */
     576    int rc = RTFileClose(pFile->hFile);
     577    if (RT_SUCCESS(rc) || rc == VERR_INVALID_HANDLE)
     578        pFile->hFile = NIL_RTFILE;
     579
     580    if (RT_SUCCESS(rc))
     581        LogRel2(("Audio: Closed file '%s' (%'RU64 bytes PCM data)\n", pFile->szName, pFile->cbWaveData));
    608582    else
    609         AssertFailedStmt(rc = VERR_NOT_IMPLEMENTED);
    610 
    611     if (   RT_SUCCESS(rc)
    612         && !cbSize
    613         && !(pFile->fFlags & AUDIOHLPFILE_FLAGS_KEEP_IF_EMPTY))
    614         rc = AudioHlpFileDelete(pFile);
    615 
    616     pFile->cbData = 0;
    617 
    618     if (RT_SUCCESS(rc))
    619     {
    620         pFile->hFile = NIL_RTFILE;
    621         LogRel2(("Audio: Closed file '%s' (%zu bytes)\n", pFile->szName, cbSize));
    622     }
    623     else
    624         LogRel(("Audio: Failed closing file '%s', rc=%Rrc\n", pFile->szName, rc));
     583        LogRel(("Audio: Failed closing file '%s': %Rrc\n", pFile->szName, rc));
     584
     585    /*
     586     * Delete empty file if requested.
     587     */
     588    if (   !(pFile->fFlags & AUDIOHLPFILE_FLAGS_KEEP_IF_EMPTY)
     589        && pFile->cbWaveData == 0
     590        && RT_SUCCESS(rc))
     591        AudioHlpFileDelete(pFile);
    625592
    626593    return rc;
     
    652619
    653620/**
    654  * Returns the raw audio data size of an audio file.
    655  *
    656  * @note This does *not* include file headers and other data which does not
    657  *       belong to the actual PCM audio data.
    658  *
    659  * @returns Size (in bytes) of the raw PCM audio data.
    660  * @param   pFile               Audio file handle to retrieve the audio data size for.
    661  */
    662 size_t AudioHlpFileGetDataSize(PAUDIOHLPFILE pFile)
    663 {
    664     AssertPtrReturn(pFile, 0);
    665 
    666     size_t cbSize = 0;
    667 
    668     if (pFile->enmType == AUDIOHLPFILETYPE_RAW)
    669         cbSize = RTFileTell(pFile->hFile);
    670     else if (pFile->enmType == AUDIOHLPFILETYPE_WAV)
    671     {
    672         PAUDIOWAVFILEDATA pData = (PAUDIOWAVFILEDATA)pFile->pvData;
    673         if (pData) /* The .WAV file data only is valid when a file actually has been created. */
    674             cbSize = pData->Hdr.u32Size2;
    675     }
    676 
    677     return cbSize;
    678 }
    679 
    680 
    681 /**
    682621 * Returns whether the given audio file is open and in use or not.
    683622 *
     
    687626bool AudioHlpFileIsOpen(PAUDIOHLPFILE pFile)
    688627{
    689     if (!pFile)
     628    if (!pFile || pFile->hFile == NIL_RTFILE)
    690629        return false;
    691630
     
    701640 * @param   pvBuf               Audio data to write.
    702641 * @param   cbBuf               Size (in bytes) of audio data to write.
    703  * @param   fFlags              Additional write flags. Not being used at the moment and must be 0.
    704  */
    705 int AudioHlpFileWrite(PAUDIOHLPFILE pFile, const void *pvBuf, size_t cbBuf, uint32_t fFlags)
     642 */
     643int AudioHlpFileWrite(PAUDIOHLPFILE pFile, const void *pvBuf, size_t cbBuf)
    706644{
    707645    AssertPtrReturn(pFile, VERR_INVALID_POINTER);
    708646    AssertPtrReturn(pvBuf, VERR_INVALID_POINTER);
    709647
    710     AssertReturn(fFlags == 0, VERR_INVALID_PARAMETER); /** @todo fFlags are currently not implemented. */
    711 
    712648    if (!cbBuf)
    713649        return VINF_SUCCESS;
    714650
    715     AssertReturn(RTFileIsValid(pFile->hFile), VERR_WRONG_ORDER);
    716 
    717     int rc;
    718 
    719     if (pFile->enmType == AUDIOHLPFILETYPE_RAW)
    720         rc = RTFileWrite(pFile->hFile, pvBuf, cbBuf, NULL);
    721     else if (pFile->enmType == AUDIOHLPFILETYPE_WAV)
    722     {
    723         PAUDIOWAVFILEDATA pData = (PAUDIOWAVFILEDATA)pFile->pvData;
    724         AssertPtr(pData);
    725 
    726         rc = RTFileWrite(pFile->hFile, pvBuf, cbBuf, NULL);
    727         if (RT_SUCCESS(rc))
    728         {
    729             pData->Hdr.u32Size  += (uint32_t)cbBuf;
    730             pData->Hdr.u32Size2 += (uint32_t)cbBuf;
    731         }
    732     }
    733     else
    734         rc = VERR_NOT_SUPPORTED;
     651    int rc = RTFileWrite(pFile->hFile, pvBuf, cbBuf, NULL);
     652    if (RT_SUCCESS(rc))
     653        pFile->cbWaveData += cbBuf;
    735654
    736655    return rc;
  • trunk/src/VBox/Devices/Audio/AudioHlp.h

    r90011 r90012  
    9494    /** Audio file flags, AUDIOHLPFILE_FLAGS_XXX. */
    9595    uint32_t            fFlags;
     96    /** Amount of wave data written. */
     97    uint64_t            cbWaveData;
    9698    /** Actual file handle. */
    9799    RTFILE              hFile;
    98     /** Data needed for the specific audio file type implemented.
    99      * Optional, can be NULL. */
    100     void               *pvData;
    101     /** Data size (in bytes). */
    102     size_t              cbData;
    103100    /** File name and path. */
    104101    RT_FLEXIBLE_ARRAY_EXTENSION
     
    119116
    120117void    AudioHlpFileDestroy(PAUDIOHLPFILE pFile);
    121 int     AudioHlpFileOpen(PAUDIOHLPFILE pFile, uint32_t fOpen, PCPDMAUDIOPCMPROPS pProps);
     118int     AudioHlpFileOpen(PAUDIOHLPFILE pFile, uint64_t fOpen, PCPDMAUDIOPCMPROPS pProps);
    122119int     AudioHlpFileClose(PAUDIOHLPFILE pFile);
    123120int     AudioHlpFileDelete(PAUDIOHLPFILE pFile);
    124 size_t  AudioHlpFileGetDataSize(PAUDIOHLPFILE pFile);
    125121bool    AudioHlpFileIsOpen(PAUDIOHLPFILE pFile);
    126 int     AudioHlpFileWrite(PAUDIOHLPFILE pFile, const void *pvBuf, size_t cbBuf, uint32_t fFlags);
     122int     AudioHlpFileWrite(PAUDIOHLPFILE pFile, const void *pvBuf, size_t cbBuf);
    127123/** @}  */
    128 
    129 #define AUDIO_MAKE_FOURCC(c0, c1, c2, c3) RT_H2LE_U32_C(RT_MAKE_U32_FROM_U8(c0, c1, c2, c3))
    130124
    131125#endif /* !VBOX_INCLUDED_SRC_Audio_AudioHlp_h */
  • trunk/src/VBox/Devices/Audio/AudioMixer.cpp

    r90007 r90012  
    20322032        { /* likely */ }
    20332033        else
    2034             AudioHlpFileWrite(pDbgFile, pvSrcBuf, cbSrcBuf, 0 /* fFlags */);
     2034            AudioHlpFileWrite(pDbgFile, pvSrcBuf, cbSrcBuf);
    20352035
    20362036
     
    21532153        { /* likely */ }
    21542154        else
    2155             AudioHlpFileWrite(pDbgFile, abBuf, cbRead, 0 /* fFlags */);
     2155            AudioHlpFileWrite(pDbgFile, abBuf, cbRead);
    21562156
    21572157        /* Advance. */
  • trunk/src/VBox/Devices/Audio/DevHdaStream.cpp

    r90011 r90012  
    15941594                { /* likely */ }
    15951595                else
    1596                     AudioHlpFileWrite(pStreamR3->Dbg.Runtime.pFileDMARaw, pvBufSrc, cbBufSrc, 0 /* fFlags */);
     1596                    AudioHlpFileWrite(pStreamR3->Dbg.Runtime.pFileDMARaw, pvBufSrc, cbBufSrc);
    15971597
    15981598# ifdef VBOX_WITH_DTRACE
     
    17781778            { /* likely */ }
    17791779            else
    1780                 AudioHlpFileWrite(pStreamR3->Dbg.Runtime.pFileDMARaw, pvBufDst, cbBufDst, 0 /* fFlags */);
     1780                AudioHlpFileWrite(pStreamR3->Dbg.Runtime.pFileDMARaw, pvBufDst, cbBufDst);
    17811781
    17821782# ifdef VBOX_WITH_DTRACE
     
    22012201                { /* likely */ }
    22022202                else
    2203                     AudioHlpFileWrite(pStreamR3->Dbg.Runtime.pFileDMARaw, pvBufDst, cbBufDst, 0 /* fFlags */);
     2203                    AudioHlpFileWrite(pStreamR3->Dbg.Runtime.pFileDMARaw, pvBufDst, cbBufDst);
    22042204
    22052205                RTCircBufReleaseWriteBlock(pCircBuf, cbBufDst);
  • trunk/src/VBox/Devices/Audio/DevIchAc97.cpp

    r90011 r90012  
    10991099                { /* likely */ }
    11001100                else
    1101                     AudioHlpFileWrite(pStreamCC->Dbg.Runtime.pFileDMA, pvDst, cbDst, 0 /* fFlags */);
     1101                    AudioHlpFileWrite(pStreamCC->Dbg.Runtime.pFileDMA, pvDst, cbDst);
    11021102            }
    11031103
     
    11231123                { /* likely */ }
    11241124                else
    1125                     AudioHlpFileWrite(pStreamCC->Dbg.Runtime.pFileDMA, pvSrc, cbSrc, 0 /* fFlags */);
     1125                    AudioHlpFileWrite(pStreamCC->Dbg.Runtime.pFileDMA, pvSrc, cbSrc);
    11261126            }
    11271127
  • trunk/src/VBox/Devices/Audio/DevSB16.cpp

    r90011 r90012  
    19451945        { /* likely */ }
    19461946        else
    1947             AudioHlpFileWrite(pStream->Dbg.Runtime.pFileDMA, pv, cbRead, 0 /* fFlags */);
     1947            AudioHlpFileWrite(pStream->Dbg.Runtime.pFileDMA, pv, cbRead);
    19481948
    19491949        RTCircBufReleaseWriteBlock(pStream->State.pCircBuf, cbRead);
  • trunk/src/VBox/Devices/Audio/DrvAudio.cpp

    r89830 r90012  
    34953495            { /* likely */ }
    34963496            else
    3497                 AudioHlpFileWrite(pStreamEx->Out.Dbg.pFilePlay, pvBuf, *pcbWritten, 0 /* fFlags */);
     3497                AudioHlpFileWrite(pStreamEx->Out.Dbg.pFilePlay, pvBuf, *pcbWritten);
    34983498        }
    34993499        else
     
    37843784            { /* likely */ }
    37853785            else
    3786                 AudioHlpFileWrite(pStreamEx->In.Dbg.pFileCapture, pvBuf, *pcbRead, 0 /* fFlags */);
     3786                AudioHlpFileWrite(pStreamEx->In.Dbg.pFileCapture, pvBuf, *pcbRead);
    37873787        }
    37883788        else
  • trunk/src/VBox/Devices/Audio/DrvHostAudioDebug.cpp

    r90011 r90012  
    240240    PDRVHSTAUDDEBUGSTREAM pStreamDbg = (PDRVHSTAUDDEBUGSTREAM)pStream;
    241241
    242     int rc = AudioHlpFileWrite(pStreamDbg->pFile, pvBuf, cbBuf, 0 /* fFlags */);
     242    int rc = AudioHlpFileWrite(pStreamDbg->pFile, pvBuf, cbBuf);
    243243    if (RT_SUCCESS(rc))
    244244        *pcbWritten = cbBuf;
     
    278278         * Write it.
    279279         */
    280         rc = AudioHlpFileWrite(pStreamDbg->pFile, pvBuf, cbWritten, 0 /* fFlags */);
     280        rc = AudioHlpFileWrite(pStreamDbg->pFile, pvBuf, cbWritten);
    281281        if (RT_SUCCESS(rc))
    282282            *pcbRead = cbWritten;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette