- Timestamp:
- Nov 4, 2016 12:26:57 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioMixBuffer.cpp
r64047 r64565 226 226 227 227 pIter->cMixed -= RT_MIN(pIter->cMixed, cSamplesToClear); 228 pIter->cUsed -= RT_MIN(pIter->cUsed, AUDIOMIXBUF_S2S_RATIO(pMixBuf, cSamplesToClear)); 228 229 } 229 230 … … 974 975 * 975 976 * @return IPRT status code. 977 * VERR_NO_DATA if the source does not have any audio data. 978 * VERR_BUFFER_UNDERFLOW if the source did not have enough audio data. 979 * VERR_BUFFER_OVERFLOW if the destination did not have enough space to store the converted source audio data. 980 * 976 981 * @param pDst Destination mixing buffer. 977 982 * @param pSrc Source mixing buffer. … … 996 1001 if (pcProcessed) 997 1002 *pcProcessed = 0; 998 return V INF_SUCCESS;1003 return VERR_BUFFER_OVERFLOW; 999 1004 } 1000 1005 … … 1009 1014 uint32_t offDstWrite = pDst->offWrite; 1010 1015 1011 if ( !cSrcAvail 1012 || !cDstAvail) 1013 { 1014 if (pcProcessed) 1015 *pcProcessed = 0; 1016 return VINF_SUCCESS; 1017 } 1016 if (!cSrcAvail) 1017 return VERR_NO_DATA; 1018 1018 1019 1019 AUDMIXBUF_LOG(("cSrcSamples=%RU32, cSrcAvail=%RU32 -> cDstAvail=%RU32\n", cSrcSamples, cSrcAvail, cDstAvail)); … … 1091 1091 if (pDst->cUsed > pDst->cSamples) 1092 1092 { 1093 LogF lowFunc(("Warning: Destination buffer used %RU32 / %RU32 samples\n", pDst->cUsed, pDst->cSamples));1093 LogFunc(("Warning: Destination buffer used %RU32 / %RU32 samples\n", pDst->cUsed, pDst->cSamples)); 1094 1094 pDst->offWrite = 0; 1095 1095 pDst->cUsed = pDst->cSamples; … … 1099 1099 else if (!cSrcToRead && cDstAvail) 1100 1100 { 1101 AUDMIXBUF_LOG(("Warning: Source buffer '%s' ran out of data\n", pSrc->pszName));1101 LogFunc(("Warning: Source buffer '%s' ran out of data\n", pSrc->pszName)); 1102 1102 rc = VERR_BUFFER_UNDERFLOW; 1103 1103 } 1104 1104 else if (cSrcAvail && !cDstAvail) 1105 1105 { 1106 AUDMIXBUF_LOG(("Warning: Destination buffer '%s' full (%RU32 source samples left)\n", pDst->pszName, cSrcAvail));1106 LogFunc(("Warning: Destination buffer '%s' full (%RU32 source samples left)\n", pDst->pszName, cSrcAvail)); 1107 1107 rc = VERR_BUFFER_OVERFLOW; 1108 1108 } … … 1124 1124 * Mixes audio samples down to the parent mixing buffer. 1125 1125 * 1126 * @return IPRT status code. 1126 * @return IPRT status code. See audioMixBufMixTo() for a more detailed explanation. 1127 1127 * @param pMixBuf Mixing buffer to mix samples down to parent. 1128 1128 * @param cSamples Number of audio samples of specified mixing buffer to to mix … … 1153 1153 DECL_FORCE_INLINE(void) audioMixBufDbgPrintSingle(PPDMAUDIOMIXBUF pMixBuf, bool fIsParent, uint16_t uIdtLvl) 1154 1154 { 1155 AUDMIXBUF_LOG(("%*s[%s] %s: offRead=%RU32, offWrite=%RU32, cMixed=%RU32 -> %RU32/%RU32\n",1156 1157 1155 LogFunc(("%*s[%s] %s: offRead=%RU32, offWrite=%RU32, cMixed=%RU32 -> %RU32/%RU32\n", 1156 uIdtLvl * 4, "", fIsParent ? "PARENT" : "CHILD", 1157 pMixBuf->pszName, pMixBuf->offRead, pMixBuf->offWrite, pMixBuf->cMixed, pMixBuf->cUsed, pMixBuf->cSamples)); 1158 1158 } 1159 1159 … … 1222 1222 pParent = pMixBuf->pParent; 1223 1223 1224 AUDMIXBUF_LOG(("***************************************************************************************\n"));1224 LogFunc(("***************************************************************************************\n")); 1225 1225 1226 1226 audioMixBufDbgPrintSingle(pMixBuf, pParent == pMixBuf /* fIsParent */, 0 /* iIdtLevel */); … … 1234 1234 } 1235 1235 1236 AUDMIXBUF_LOG(("***************************************************************************************\n"));1236 LogFunc(("***************************************************************************************\n")); 1237 1237 } 1238 1238 … … 1260 1260 { 1261 1261 AssertPtrReturn(pMixBuf, 0); 1262 1263 AUDMIXBUF_LOG(("%s: cUsed=%RU32\n", pMixBuf->pszName, pMixBuf->cUsed));1264 1262 return pMixBuf->cUsed; 1265 1263 } … … 1746 1744 * The sample format being written must match the format of the mixing buffer. 1747 1745 * 1748 * @return IPRT status code, or V INF_BUFFER_OVERFLOW if samples which not have1746 * @return IPRT status code, or VERR_BUFFER_OVERFLOW if samples which not have 1749 1747 * been processed yet have been overwritten (due to cyclic buffer). 1750 1748 * @param pMixBuf Pointer to mixing buffer to write to. … … 1763 1761 * Writes audio samples of a specific format. 1764 1762 * 1765 * @return IPRT status code, or V INF_BUFFER_OVERFLOW if samples which not have1763 * @return IPRT status code, or VERR_BUFFER_OVERFLOW if samples which not have 1766 1764 * been processed yet have been overwritten (due to cyclic buffer). 1767 1765 * @param pMixBuf Pointer to mixing buffer to write to. … … 1799 1797 pMixBuf->pszName, pMixBuf->pParent->pszName)); 1800 1798 1801 return V INF_BUFFER_OVERFLOW;1799 return VERR_BUFFER_OVERFLOW; 1802 1800 } 1803 1801 … … 1905 1903 pMixBuf->cUsed = pMixBuf->cSamples; 1906 1904 1907 rc = V INF_BUFFER_OVERFLOW;1905 rc = VERR_BUFFER_OVERFLOW; 1908 1906 } 1909 1907
Note:
See TracChangeset
for help on using the changeset viewer.