VirtualBox

Changeset 68358 in vbox


Ignore:
Timestamp:
Aug 9, 2017 3:25:45 PM (7 years ago)
Author:
vboxsync
Message:

Audio/DrvHostPulseAudio.cpp: Removed PULSEAUDIO_ASYNC and put the code within DEBUG defines. Not needed otherwise.

File:
1 edited

Legend:

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

    r68357 r68358  
    4646#define VBOX_PULSEAUDIO_MAX_LOG_REL_ERRORS 32 /** @todo Make this configurable thru driver options. */
    4747
    48 /* Whether to use PulseAudio's asynchronous handling or not. */
    49 //#define PULSEAUDIO_ASYNC /** @todo Make this configurable thru driver options. */
    50 
    5148#ifndef PA_STREAM_NOFLAGS
    5249# define PA_STREAM_NOFLAGS (pa_context_flags_t)0x0000U /* since 0.9.19 */
     
    6663    ( (PDRVHOSTPULSEAUDIO)((uintptr_t)pInterface - RT_OFFSETOF(DRVHOSTPULSEAUDIO, IHostAudio)) )
    6764
    68 #define PULSEAUDIO_ASYNC
    6965
    7066/*********************************************************************************************************************************
     
    191187static int  paEnumerate(PDRVHOSTPULSEAUDIO pThis, PPDMAUDIOBACKENDCFG pCfg, uint32_t fEnum);
    192188static int  paError(PDRVHOSTPULSEAUDIO pThis, const char *szMsg);
     189#ifdef DEBUG
    193190static void paStreamCbUnderflow(pa_stream *pStream, void *pvContext);
    194 #ifdef PULSEAUDIO_ASYNC
    195  static void paStreamCbReqWrite(pa_stream *pStream, size_t cbLen, void *pvContext);
     191static void paStreamCbReqWrite(pa_stream *pStream, size_t cbLen, void *pvContext);
    196192#endif
    197193static void paStreamCbSuccess(pa_stream *pStream, int fSuccess, void *pvContext);
     
    407403
    408404
    409 #ifdef PULSEAUDIO_ASYNC
     405#ifdef DEBUG
    410406static void paStreamCbReqWrite(pa_stream *pStream, size_t cbLen, void *pvContext)
    411407{
     
    421417    Log2Func(("Requested %zu bytes -- Current latency is %RU64ms\n", cbLen, usec / 1000));
    422418}
    423 #endif /* PULSEAUDIO_ASYNC */
    424419
    425420
     
    448443    }
    449444
    450 #ifdef LOG_ENABLED
     445# ifdef LOG_ENABLED
    451446    pa_usec_t curLatencyUs = 0;
    452447    pa_stream_get_latency(pStream, &curLatencyUs, NULL /* Neg */);
     
    460455    Log2Func(("curPosWrite=%RU64ms, curTs=%RU64ms, curDelta=%RI64ms, curLatency=%RU64ms\n",
    461456              curPosWritesUs / 1000, curTsUs / 1000, (((int64_t)curPosWritesUs - (int64_t)curTsUs) / 1000), curLatencyUs / 1000));
    462 #endif
    463 }
    464 
    465 
    466 #ifdef VBOX_STRICT
     457# endif
     458}
     459
     460
    467461static void paStreamCbOverflow(pa_stream *pStream, void *pvContext)
    468462{
     
    471465    Log2Func(("Warning: Hit overflow\n"));
    472466}
    473 #endif
     467#endif /* DEBUG */
    474468
    475469
     
    528522        }
    529523
    530 #ifdef PULSEAUDIO_ASYNC
     524#ifdef DEBUG
    531525        pa_stream_set_write_callback       (pStream, paStreamCbReqWrite,     pStreamPA);
    532 #endif
    533526        pa_stream_set_underflow_callback   (pStream, paStreamCbUnderflow,    pStreamPA);
    534 #ifdef VBOX_STRICT
    535527        if (!fIn) /* Only for output streams. */
    536528            pa_stream_set_overflow_callback(pStream, paStreamCbOverflow,     pStreamPA);
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