Changeset 67520 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 21, 2017 6:59:46 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostPulseAudio.cpp
r67518 r67520 273 273 * Synchronously wait until an operation completed. 274 274 */ 275 static int paWaitForEx(PDRVHOSTPULSEAUDIO pThis, pa_operation *pOP, RTMSINTERVAL cMsTimeout )275 static int paWaitForEx(PDRVHOSTPULSEAUDIO pThis, pa_operation *pOP, RTMSINTERVAL cMsTimeout, bool fDebug) 276 276 { 277 277 AssertPtrReturn(pThis, VERR_INVALID_POINTER); … … 287 287 { 288 288 AssertPtr(pThis->pMainLoop); 289 if (fDebug) 290 LogRel(("PulseAudio: pa_threaded_mainloop_wait\n")); 289 291 pa_threaded_mainloop_wait(pThis->pMainLoop); 292 if (fDebug) 293 LogRel(("PulseAudio: pa_threaded_mainloop_wait done\n")); 290 294 if (pThis->fAbortEnumLoop) 291 295 break; … … 307 311 308 312 309 static int paWaitFor(PDRVHOSTPULSEAUDIO pThis, pa_operation *pOP )310 { 311 return paWaitForEx(pThis, pOP, 10 * 1000 /* 10s timeout */ );313 static int paWaitFor(PDRVHOSTPULSEAUDIO pThis, pa_operation *pOP, bool fDebug = false) 314 { 315 return paWaitForEx(pThis, pOP, 10 * 1000 /* 10s timeout */, fDebug); 312 316 } 313 317 … … 935 939 static void paEnumSinkCb(pa_context *pCtx, const pa_sink_info *pInfo, int eol, void *pvUserData) 936 940 { 941 LogRel(("PulseAudio: entering paEnumSinkCb\n")); 937 942 if (eol > 0) 943 { 944 LogRel(("PulseAudio: paEnumSinkCb: eol=%d\n", eol)); 938 945 return; 946 } 939 947 940 948 PPULSEAUDIOENUMCBCTX pCbCtx = (PPULSEAUDIOENUMCBCTX)pvUserData; … … 946 954 pThis->fAbortEnumLoop = true; 947 955 pa_threaded_mainloop_signal(pCbCtx->pDrv->pMainLoop, 0); 956 LogRel(("PulseAudio: paEnumSinkCb eol=%d, signalling\n", eol)); 948 957 return; 949 958 } … … 957 966 pCbCtx->cDevOut++; 958 967 968 LogRel(("PulseAudio: paEnumSinkCb signalling\n")); 959 969 pa_threaded_mainloop_signal(pCbCtx->pDrv->pMainLoop, 0); 960 970 } … … 963 973 static void paEnumSourceCb(pa_context *pCtx, const pa_source_info *pInfo, int eol, void *pvUserData) 964 974 { 975 LogRel(("PulseAudio: entering paEnumSourceCb\n")); 965 976 if (eol > 0) 977 { 978 LogRel(("PulseAudio: paEnumSourceCb: eol=%d\n", eol)); 966 979 return; 980 } 967 981 968 982 PPULSEAUDIOENUMCBCTX pCbCtx = (PPULSEAUDIOENUMCBCTX)pvUserData; … … 974 988 pThis->fAbortEnumLoop = true; 975 989 pa_threaded_mainloop_signal(pCbCtx->pDrv->pMainLoop, 0); 990 LogRel(("PulseAudio: paEnumSourceCb eol=%d, signalling\n", eol)); 976 991 return; 977 992 } … … 985 1000 pCbCtx->cDevIn++; 986 1001 1002 LogRel(("PulseAudio: paEnumSourceCb signalling\n")); 987 1003 pa_threaded_mainloop_signal(pCbCtx->pDrv->pMainLoop, 0); 988 1004 } … … 991 1007 static void paEnumServerCb(pa_context *pCtx, const pa_server_info *pInfo, void *pvUserData) 992 1008 { 1009 LogRel(("PulseAudio: entering paEnumServerCb\n")); 1010 993 1011 AssertPtrReturnVoid(pCtx); 994 1012 PPULSEAUDIOENUMCBCTX pCbCtx = (PPULSEAUDIOENUMCBCTX)pvUserData; … … 1000 1018 { 1001 1019 pThis->fAbortEnumLoop = true; 1020 LogRel(("PulseAudio: paEnumServerCb no info, signalling\n")); 1002 1021 pa_threaded_mainloop_signal(pCbCtx->pDrv->pMainLoop, 0); 1003 1022 return; … … 1016 1035 } 1017 1036 1037 LogRel(("PulseAudio: paEnumServerCb signalling\n")); 1018 1038 pa_threaded_mainloop_signal(pThis->pMainLoop, 0); 1019 1039 } … … 1041 1061 bool fLog = (fEnum & PULSEAUDIOENUMCBFLAGS_LOG); 1042 1062 1043 int rc = paWaitFor(pThis, pa_context_get_server_info(pThis->pContext, paEnumServerCb, &CbCtx)); 1063 LogRel(("PulseAudio: starting server enumeration\n")); 1064 int rc = paWaitFor(pThis, pa_context_get_server_info(pThis->pContext, paEnumServerCb, &CbCtx), true); 1065 LogRel(("PulseAudio: server enumeration done rc=%Rrc abort=%d\n", rc, pThis->fAbortEnumLoop)); 1044 1066 if ( RT_SUCCESS(rc) 1045 1067 && pThis->fAbortEnumLoop) … … 1052 1074 LogRel2(("PulseAudio: Default output sink is '%s'\n", CbCtx.pszDefaultSink)); 1053 1075 1076 LogRel(("PulseAudio: starting sink enumeration\n")); 1054 1077 rc = paWaitFor(pThis, pa_context_get_sink_info_by_name(pThis->pContext, CbCtx.pszDefaultSink, 1055 paEnumSinkCb, &CbCtx)); 1078 paEnumSinkCb, &CbCtx), true); 1079 LogRel(("PulseAudio: sink enumeration done rc=%Rrc abort=%d\n", rc, pThis->fAbortEnumLoop)); 1056 1080 if ( RT_SUCCESS(rc) 1057 1081 && pThis->fAbortEnumLoop) … … 1073 1097 LogRel2(("PulseAudio: Default input source is '%s'\n", CbCtx.pszDefaultSource)); 1074 1098 1099 LogRel(("PulseAudio: starting source enumeration\n")); 1075 1100 rc = paWaitFor(pThis, pa_context_get_source_info_by_name(pThis->pContext, CbCtx.pszDefaultSource, 1076 paEnumSourceCb, &CbCtx)); 1101 paEnumSourceCb, &CbCtx), true); 1102 LogRel(("PulseAudio: source enumeration done rc=%Rrc abort=%d\n", rc, pThis->fAbortEnumLoop)); 1077 1103 if ( RT_FAILURE(rc) 1078 1104 && fLog)
Note:
See TracChangeset
for help on using the changeset viewer.