Changeset 64968 in vbox
- Timestamp:
- Dec 20, 2016 6:55:21 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioMixer.cpp
r64868 r64968 68 68 static void audioMixerStreamDestroyInternal(PAUDMIXSTREAM pStream); 69 69 70 71 #ifdef LOG_ENABLED 72 /** 73 * Converts a mixer sink status to a string. 74 * 75 * @returns Stringified mixer sink flags. Must be free'd with RTStrFree(). 76 * "NONE" if no flags set. 77 * @param fFlags Mixer sink flags to convert. 78 */ 79 char *dbgAudioMixerSinkStatusToStr(AUDMIXSINKSTS fStatus) 80 { 81 #define APPEND_FLAG_TO_STR(_aFlag) \ 82 if (fStatus & AUDMIXSINK_STS_##_aFlag) \ 83 { \ 84 if (pszFlags) \ 85 { \ 86 rc2 = RTStrAAppend(&pszFlags, " "); \ 87 if (RT_FAILURE(rc2)) \ 88 break; \ 89 } \ 90 \ 91 rc2 = RTStrAAppend(&pszFlags, #_aFlag); \ 92 if (RT_FAILURE(rc2)) \ 93 break; \ 94 } \ 95 96 char *pszFlags = NULL; 97 int rc2 = VINF_SUCCESS; 98 99 do 100 { 101 APPEND_FLAG_TO_STR(NONE); 102 APPEND_FLAG_TO_STR(RUNNING); 103 APPEND_FLAG_TO_STR(PENDING_DISABLE); 104 APPEND_FLAG_TO_STR(DIRTY); 105 106 } while (0); 107 108 if ( RT_FAILURE(rc2) 109 && pszFlags) 110 { 111 RTStrFree(pszFlags); 112 pszFlags = NULL; 113 } 114 115 #undef APPEND_FLAG_TO_STR 116 117 return pszFlags; 118 } 119 #endif /* DEBUG */ 70 120 71 121 /** … … 682 732 } 683 733 684 LogFlowFunc(("[%s]: enmCmd=%d, fStatus=0x%x, rc=%Rrc\n", pSink->pszName, enmSinkCmd, pSink->fStatus, rc)); 734 #ifdef LOG_ENABLED 735 char *pszStatus = dbgAudioMixerSinkStatusToStr(pSink->fStatus); 736 LogFlowFunc(("[%s]: enmCmd=%d, fStatus=%s, rc=%Rrc\n", pSink->pszName, enmSinkCmd, pszStatus, rc)); 737 RTStrFree(pszStatus); 738 #endif 685 739 686 740 /* Not running anymore? Reset. */ … … 1009 1063 ("Can't read from a sink which is not an input sink\n")); 1010 1064 1011 #ifndef VBOX_AUDIO_MIXER_WITH_MIXBUF 1065 #ifdef VBOX_AUDIO_MIXER_WITH_MIXBUF 1066 # error "Implement me!" 1067 #else 1012 1068 uint8_t *pvMixBuf = (uint8_t *)RTMemAlloc(cbBuf); 1013 1069 if (!pvMixBuf) … … 1053 1109 LogFunc(("[%s] Failed reading from stream '%s': %Rrc\n", pSink->pszName, pMixStream->pszName, rc2)); 1054 1110 1111 Log3Func(("[%s] Stream '%s': Read %RU32 bytes\n", pSink->pszName, pMixStream->pszName, cbReadStrm)); 1112 1055 1113 if ( RT_FAILURE(rc2) 1056 1114 || !cbReadStrm) … … 1095 1153 #endif 1096 1154 1097 Log3Func(("[%s] cbRead=%RU32, fClean=%RTbool, fStatus=0x%x, rc=%Rrc\n", pSink->pszName, cbRead, fClean, pSink->fStatus, rc)); 1155 1156 #ifdef LOG_ENABLED 1157 char *pszStatus = dbgAudioMixerSinkStatusToStr(pSink->fStatus); 1158 Log2Func(("[%s] cbRead=%RU32, fClean=%RTbool, fStatus=%s, rc=%Rrc\n", pSink->pszName, cbRead, fClean, pszStatus, rc)); 1159 RTStrFree(pszStatus); 1160 #endif 1098 1161 1099 1162 int rc2 = RTCritSectLeave(&pSink->CritSect); … … 1350 1413 int rc = VINF_SUCCESS; 1351 1414 1352 Log3Func(("[%s] fStatus=0x%x\n", pSink->pszName, pSink->fStatus)); 1415 #ifdef LOG_ENABLED 1416 char *pszStatus = dbgAudioMixerSinkStatusToStr(pSink->fStatus); 1417 Log3Func(("[%s] fStatus=%s\n", pSink->pszName, pszStatus)); 1418 RTStrFree(pszStatus); 1419 #endif 1353 1420 1354 1421 /* Sink disabled? Take a shortcut. */ … … 1535 1602 return rc; 1536 1603 1537 AssertMsg(pSink->fStatus & AUDMIXSINK_STS_RUNNING, ("%s: Can't write to a sink which is not running (anymore)\n",1538 pSink->pszName));1539 AssertMsg(pSink->enmDir == AUDMIXSINKDIR_OUTPUT, ("%s: Can't write to a sink which is not an output sink\n",1540 1604 AssertMsg(pSink->fStatus & AUDMIXSINK_STS_RUNNING, 1605 ("%s: Can't write to a sink which is not running (anymore) (status 0x%x)\n", pSink->pszName, pSink->fStatus)); 1606 AssertMsg(pSink->enmDir == AUDMIXSINKDIR_OUTPUT, 1607 ("%s: Can't write to a sink which is not an output sink\n", pSink->pszName)); 1541 1608 1542 1609 Log3Func(("[%s] enmOp=%d, cbBuf=%RU32\n", pSink->pszName, enmOp, cbBuf));
Note:
See TracChangeset
for help on using the changeset viewer.