Changeset 54234 in vbox
- Timestamp:
- Feb 17, 2015 3:04:53 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchHda.cpp
r54230 r54234 37 37 #include <iprt/list.h> 38 38 39 #if 040 /* Warning: Enabling this causes a *lot* of output! */41 39 #ifdef LOG_GROUP 42 40 # undef LOG_GROUP … … 44 42 #define LOG_GROUP LOG_GROUP_DEV_AUDIO 45 43 #include <VBox/log.h> 46 #endif47 44 48 45 #include "VBoxDD.h" … … 2264 2261 { 2265 2262 /* if we enter here we can't report "unreported bits" */ 2266 rc = V ERR_NO_DATA;2263 rc = VINF_EOF; 2267 2264 } 2268 2265 else … … 2290 2287 { 2291 2288 hdaBackendTransferUnreported(pThis, pBdle, pStreamDesc, cbBackendCopy, pu32Avail); 2292 rc = V ERR_NO_DATA;2289 rc = VINF_EOF; 2293 2290 } 2294 2291 } … … 2325 2322 if (!cb2Copy) 2326 2323 { 2327 rc = V ERR_NO_DATA;2324 rc = VINF_EOF; 2328 2325 } 2329 2326 else … … 2350 2347 if (pDrv->pConnector->pfnIsActiveOut(pDrv->pConnector, pDrv->Out.pStrmOut)) 2351 2348 { 2352 rc= pDrv->pConnector->pfnWrite(pDrv->pConnector, pDrv->Out.pStrmOut,2353 pBdle->au8HdaBuffer, cb2Copy + pBdle->cbUnderFifoW,2354 &cbWritten);2355 if (RT_FAILURE(rc ))2349 int rc2 = pDrv->pConnector->pfnWrite(pDrv->pConnector, pDrv->Out.pStrmOut, 2350 pBdle->au8HdaBuffer, cb2Copy + pBdle->cbUnderFifoW, 2351 &cbWritten); 2352 if (RT_FAILURE(rc2)) 2356 2353 continue; 2357 2354 } … … 2375 2372 /* Not enough bytes to be processed and reported, we'll try our luck next time around. */ 2376 2373 hdaBackendTransferUnreported(pThis, pBdle, pStreamDesc, cb2Copy, NULL); 2377 rc = V ERR_NO_DATA;2374 rc = VINF_EOF; 2378 2375 } 2379 2376 } … … 2550 2547 2551 2548 PHDADRIVER pDrv; 2552 uint32_t cbIn, cbOut; 2549 2550 LogFlowFuncEnter(); 2553 2551 2554 2552 RTListForEach(&pThis->lstDrv, pDrv, HDADRIVER, Node) 2555 2553 { 2556 if (!pDrv->pConnector->pfnIsOutputOK(pDrv->pConnector, pDrv->Out.pStrmOut)) 2557 { 2558 pDrv->cSamplesLive = 0; 2559 continue; 2560 } 2561 2554 uint32_t cbIn, cbOut; 2562 2555 rc = pDrv->pConnector->pfnQueryStatus(pDrv->pConnector, 2563 2556 &cbIn, &cbOut, &pDrv->cSamplesLive); 2564 2557 if (RT_SUCCESS(rc)) 2565 2558 { 2566 if (cbIn || cbOut) 2567 LogFlowFunc(("\tLUN#%RU8: cbIn=%RU32, cbOut=%RU32\n", pDrv->uLUN, cbIn, cbOut)); 2559 LogFlowFunc(("\tLUN#%RU8: [1] cbIn=%RU32, cbOut=%RU32\n", pDrv->uLUN, cbIn, cbOut)); 2560 2561 if (pDrv->cSamplesLive) 2562 { 2563 uint32_t cSamplesPlayed; 2564 int rc2 = pDrv->pConnector->pfnPlayOut(pDrv->pConnector, &cSamplesPlayed); 2565 if (RT_SUCCESS(rc2)) 2566 { 2567 LogFlowFunc(("LUN#%RU8: cSamplesLive=%RU32, cSamplesPlayed=%RU32\n", 2568 pDrv->uLUN, pDrv->cSamplesLive, cSamplesPlayed)); 2569 Assert(pDrv->cSamplesLive >= cSamplesPlayed); 2570 pDrv->cSamplesLive -= cSamplesPlayed; 2571 } 2572 2573 rc = pDrv->pConnector->pfnQueryStatus(pDrv->pConnector, 2574 &cbIn, &cbOut, &pDrv->cSamplesLive); 2575 if (RT_SUCCESS(rc)) 2576 LogFlowFunc(("\tLUN#%RU8: [2] cbIn=%RU32, cbOut=%RU32\n", pDrv->uLUN, cbIn, cbOut)); 2577 } 2568 2578 2569 2579 cbInMax = RT_MAX(cbInMax, cbIn); … … 2574 2584 } 2575 2585 2586 LogFlowFunc(("cbInMax=%RU32, cbOutMin=%RU32\n", cbInMax, cbOutMin)); 2587 2588 if (cbOutMin == UINT32_MAX) 2589 cbOutMin = 0; 2590 2576 2591 /* 2577 2592 * Playback. … … 2581 2596 Assert(cbOutMin != UINT32_MAX); 2582 2597 hdaTransfer(pThis, PO_INDEX, cbOutMin); /** @todo Add rc! */ 2583 }2584 else2585 {2586 RTListForEach(&pThis->lstDrv, pDrv, HDADRIVER, Node)2587 {2588 /*if (pDrv->cSamplesLive)2589 pDrv->pConnector->pfnPlayOut(pDrv->pConnector);*/2590 }2591 2598 } 2592 2599 … … 2598 2605 2599 2606 TMTimerSet(pThis->pTimer, TMTimerGet(pThis->pTimer) + pThis->uTicks); 2607 2608 LogFlowFuncLeave(); 2600 2609 2601 2610 STAM_PROFILE_STOP(&pThis->StatTimer, a); … … 2705 2714 hdaStreamCounterUpdate(pThis, pBdle, &StreamDesc, cbWritten); 2706 2715 2707 if ( !hdaDoNextTransferCycle(pThis, pBdle, &StreamDesc)2708 || RT_FAILURE(rc))2709 { 2710 if (rc == VERR_NO_DATA) /* No more data to process. */2711 rc = VINF_SUCCESS;2712 2716 if (!hdaDoNextTransferCycle(pThis, pBdle, &StreamDesc)) 2717 break; 2718 2719 if ( RT_FAILURE(rc) 2720 || rc == VINF_EOF) /* All data processed? */ 2721 { 2713 2722 break; 2714 2723 }
Note:
See TracChangeset
for help on using the changeset viewer.