Changeset 55380 in vbox for trunk/src/VBox
- Timestamp:
- Apr 22, 2015 2:14:48 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioMixBuffer.cpp
r55351 r55380 489 489 #undef AUDMIXBUF_MACRO_LOG 490 490 491 /** Dummy conversion used when the source is muted. */ 492 AUDMIXBUF_MACRO_FN uint32_t audioMixBufConvFromSilence(PPDMAUDIOSAMPLE paDst, const void *pvSrc, 493 uint32_t cbSrc, const PAUDMIXBUF_CONVOPTS pOpts) 494 { 495 /* Internally zero always corresponds to silence. */ 496 memset(paDst, 0, pOpts->cSamples * sizeof(paDst[0])); 497 return pOpts->cSamples; 498 } 499 491 500 /** 492 501 * 493 502 ** @todo Speed up the lookup by binding it to the actual stream state. 494 503 * 495 * @return IPRT status code.496 504 * @return PAUDMIXBUF_FN_CONVFROM 497 * @param enmFmt 505 * @param enmFmt The source audio stream format 506 * @param fMuted Flag determining whether the source is muted 498 507 */ 499 static inline PAUDMIXBUF_FN_CONVFROM audioMixBufConvFromLookup(PDMAUDIOMIXBUFFMT enmFmt) 500 { 508 static inline PAUDMIXBUF_FN_CONVFROM audioMixBufConvFromLookup(PDMAUDIOMIXBUFFMT enmFmt, bool fMuted) 509 { 510 if (fMuted) 511 return audioMixBufConvFromSilence; 512 501 513 if (AUDMIXBUF_FMT_SIGNED(enmFmt)) 502 514 { … … 1235 1247 return VERR_BUFFER_OVERFLOW; 1236 1248 1237 PAUDMIXBUF_FN_CONVFROM pConv = audioMixBufConvFromLookup(enmFmt );1249 PAUDMIXBUF_FN_CONVFROM pConv = audioMixBufConvFromLookup(enmFmt, pMixBuf->Volume.fMuted); 1238 1250 if (!pConv) 1239 1251 return VERR_NOT_SUPPORTED; … … 1317 1329 } 1318 1330 1319 PAUDMIXBUF_FN_CONVFROM pConv = audioMixBufConvFromLookup(enmFmt );1331 PAUDMIXBUF_FN_CONVFROM pConv = audioMixBufConvFromLookup(enmFmt, pMixBuf->Volume.fMuted); 1320 1332 if (!pConv) 1321 1333 return VERR_NOT_SUPPORTED;
Note:
See TracChangeset
for help on using the changeset viewer.