VirtualBox

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


Ignore:
Timestamp:
Mar 25, 2021 10:33:46 AM (4 years ago)
Author:
vboxsync
Message:

Audio: StreamPlay cleanups in the Debug and Null drivers. bugref:9890

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

Legend:

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

    r88269 r88286  
    217217
    218218    int rc = AudioHlpFileWrite(pStreamDbg->pFile, pvBuf, cbBuf, 0 /* fFlags */);
    219     if (RT_FAILURE(rc))
    220     {
     219    if (RT_SUCCESS(rc))
     220        *pcbWritten = cbBuf;
     221    else
    221222        LogRel(("DebugAudio: Writing output failed with %Rrc\n", rc));
    222         return rc;
    223     }
    224 
    225     *pcbWritten = cbBuf;
    226     return VINF_SUCCESS;
     223    return rc;
    227224}
    228225
  • trunk/src/VBox/Devices/Audio/DrvHostAudioNull.cpp

    r88235 r88286  
    138138 */
    139139static DECLCALLBACK(int) drvHostNullAudioHA_StreamPlay(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
    140                                                        const void *pvBuf, uint32_t uBufSize, uint32_t *puWritten)
    141 {
    142     AssertPtrReturn(pInterface, VERR_INVALID_POINTER);
    143     AssertPtrReturn(pStream,    VERR_INVALID_POINTER);
    144     AssertPtrReturn(pvBuf,      VERR_INVALID_POINTER);
    145     AssertReturn(uBufSize,         VERR_INVALID_PARAMETER);
    146 
     140                                                       const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten)
     141{
    147142    RT_NOREF(pInterface, pStream, pvBuf);
    148143
    149     /* Note: No copying of samples needed here, as this a NULL backend. */
    150 
    151     if (puWritten)
    152         *puWritten = uBufSize; /* Return all bytes as written. */
    153 
     144    /* The bitbucket never overflows. */
     145    *pcbWritten = cbBuf;
    154146    return VINF_SUCCESS;
    155147}
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