- Timestamp:
- Mar 27, 2015 7:02:12 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r54424 r54981 1049 1049 uint32_t addr = pReg->bd.addr; 1050 1050 uint32_t cbWrittenTotal = 0; 1051 uint32_t cbToRead = 0;1051 uint32_t cbToRead; 1052 1052 1053 1053 uint32_t cbToWrite = RT_MIN((uint32_t)(pReg->picb << 1), cbMax); … … 1079 1079 int rc2 = pDrv->pConnector->pfnWrite(pDrv->pConnector, pDrv->Out.pStrmOut, 1080 1080 pThis->pvReadWriteBuf, cbToRead, &cbWritten); 1081 AssertRCBreak(rc); 1081 1082 if (RT_FAILURE(rc2)) 1082 1083 continue; … … 1285 1286 PAC97DRIVER pDrv; 1286 1287 1287 LogFlowFuncEnter();1288 1289 1288 uint32_t cbIn, cbOut, cSamplesLive; 1290 1289 RTListForEach(&pThis->lstDrv, pDrv, AC97DRIVER, Node) … … 1304 1303 pDrv->uLUN, cSamplesLive, cSamplesPlayed)); 1305 1304 1306 rc = pDrv->pConnector->pfnQueryStatus(pDrv->pConnector, 1307 &cbIn, &cbOut, &cSamplesLive); 1308 if (RT_SUCCESS(rc)) 1309 LogFlowFunc(("\tLUN#%RU8: [2] cbIn=%RU32, cbOut=%RU32\n", pDrv->uLUN, cbIn, cbOut)); 1305 if (cSamplesPlayed) 1306 { 1307 rc = pDrv->pConnector->pfnQueryStatus(pDrv->pConnector, 1308 &cbIn, &cbOut, &cSamplesLive); 1309 if (RT_SUCCESS(rc)) 1310 LogFlowFunc(("\tLUN#%RU8: [2] cbIn=%RU32, cbOut=%RU32\n", pDrv->uLUN, cbIn, cbOut)); 1311 } 1310 1312 } 1311 1313 … … 1337 1339 TMTimerSet(pThis->pTimer, TMTimerGet(pThis->pTimer) + pThis->uTicks); 1338 1340 1339 LogFlowFuncLeave();1340 1341 1341 STAM_PROFILE_STOP(&pThis->StatTimer, a); 1342 1342 } … … 1366 1366 } 1367 1367 1368 int rc ;1368 int rc = VINF_SUCCESS; 1369 1369 uint32_t cbWrittenTotal = 0; 1370 1370 … … 1402 1402 { 1403 1403 case PO_INDEX: 1404 { 1405 rc = ichac97WriteAudio(pThis, pReg, cbElapsed, &cbTransferred); 1406 if ( RT_SUCCESS(rc) 1407 && cbTransferred) 1404 1408 { 1405 rc = ichac97WriteAudio(pThis, pReg, cbElapsed, &cbTransferred); 1406 if (RT_SUCCESS(rc) 1407 && cbTransferred) 1408 { 1409 cbWrittenTotal += cbTransferred; 1410 Assert(cbElapsed >= cbTransferred); 1411 cbElapsed -= cbTransferred; 1412 Assert((cbTransferred & 1) == 0); /* Else the following shift won't work */ 1413 pReg->picb -= (cbTransferred >> 1); 1414 } 1415 break; 1409 cbWrittenTotal += cbTransferred; 1410 Assert(cbElapsed >= cbTransferred); 1411 cbElapsed -= cbTransferred; 1412 Assert((cbTransferred & 1) == 0); /* Else the following shift won't work */ 1413 pReg->picb -= (cbTransferred >> 1); 1416 1414 } 1415 break; 1416 } 1417 1417 1418 1418 case PI_INDEX: 1419 1419 case MC_INDEX: 1420 { 1421 rc = ichac97ReadAudio(pThis, pReg, cbElapsed, &cbTransferred); 1422 if ( RT_SUCCESS(rc) 1423 && cbTransferred) 1420 1424 { 1421 rc = ichac97ReadAudio(pThis, pReg, cbElapsed, &cbTransferred); 1422 if (RT_SUCCESS(rc) 1423 && cbTransferred) 1424 { 1425 Assert(cbElapsed >= cbTransferred); 1426 cbElapsed -= cbTransferred; 1427 Assert((cbTransferred & 1) == 0); /* Else the following shift won't work */ 1428 pReg->picb -= (cbTransferred >> 1); 1429 } 1430 break; 1425 Assert(cbElapsed >= cbTransferred); 1426 cbElapsed -= cbTransferred; 1427 Assert((cbTransferred & 1) == 0); /* Else the following shift won't work */ 1428 pReg->picb -= (cbTransferred >> 1); 1431 1429 } 1430 break; 1431 } 1432 1432 1433 1433 default: … … 2522 2522 * Register statistics. 2523 2523 */ 2524 PDMDevHlpSTAMRegister(pDevIns, &pThis->StatTimer, STAMTYPE_PROFILE, "/Devices/AC97/Timer", STAMUNIT_TICKS_PER_CALL, "Profiling hdaTimer.");2524 PDMDevHlpSTAMRegister(pDevIns, &pThis->StatTimer, STAMTYPE_PROFILE, "/Devices/AC97/Timer", STAMUNIT_TICKS_PER_CALL, "Profiling ichac97Timer."); 2525 2525 PDMDevHlpSTAMRegister(pDevIns, &pThis->StatBytesRead, STAMTYPE_COUNTER, "/Devices/AC97/BytesRead" , STAMUNIT_BYTES, "Bytes read from AC97 emulation."); 2526 2526 PDMDevHlpSTAMRegister(pDevIns, &pThis->StatBytesWritten, STAMTYPE_COUNTER, "/Devices/AC97/BytesWritten", STAMUNIT_BYTES, "Bytes written to AC97 emulation.");
Note:
See TracChangeset
for help on using the changeset viewer.