VirtualBox

Changeset 89773 in vbox for trunk/src/VBox/Devices/Audio


Ignore:
Timestamp:
Jun 18, 2021 9:16:13 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145225
Message:

DevIchAc97: save indent. bugref:9890

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevIchAc97.cpp

    r89772 r89773  
    11021102         * Input.
    11031103         */
     1104        else if (!fWriteSilence)
     1105        {
     1106            void  *pvSrc = NULL;
     1107            size_t cbSrc = 0;
     1108            RTCircBufAcquireReadBlock(pCircBuf, cbChunk, &pvSrc, &cbSrc);
     1109
     1110            if (cbSrc)
     1111            {
     1112                int rc2 = PDMDevHlpPCIPhysWrite(pDevIns, pRegs->bd.addr, pvSrc, cbSrc);
     1113                AssertRC(rc2);
     1114
     1115                if (RT_LIKELY(!pStreamCC->Dbg.Runtime.fEnabled))
     1116                { /* likely */ }
     1117                else
     1118                    AudioHlpFileWrite(pStreamCC->Dbg.Runtime.pFileDMA, pvSrc, cbSrc, 0 /* fFlags */);
     1119            }
     1120
     1121            RTCircBufReleaseReadBlock(pCircBuf, cbSrc);
     1122
     1123            cbChunk = (uint32_t)cbSrc; /* Update the current chunk size to what really has been read. */
     1124        }
    11041125        else
    11051126        {
    1106             if (!fWriteSilence)
    1107             {
    1108                 void  *pvSrc = NULL;
    1109                 size_t cbSrc = 0;
    1110                 RTCircBufAcquireReadBlock(pCircBuf, cbChunk, &pvSrc, &cbSrc);
    1111 
    1112                 if (cbSrc)
    1113                 {
    1114                     int rc2 = PDMDevHlpPCIPhysWrite(pDevIns, pRegs->bd.addr, pvSrc, cbSrc);
    1115                     AssertRC(rc2);
    1116 
    1117                     if (RT_LIKELY(!pStreamCC->Dbg.Runtime.fEnabled))
    1118                     { /* likely */ }
    1119                     else
    1120                         AudioHlpFileWrite(pStreamCC->Dbg.Runtime.pFileDMA, pvSrc, cbSrc, 0 /* fFlags */);
    1121                 }
    1122 
    1123                 RTCircBufReleaseReadBlock(pCircBuf, cbSrc);
    1124 
    1125                 cbChunk = (uint32_t)cbSrc; /* Update the current chunk size to what really has been read. */
    1126             }
    1127             else
    1128             {
    1129                 /* Since the format is signed 16-bit or 32-bit integer samples, we can
    1130                    use g_abRTZero64K as source and avoid some unnecessary bzero() work. */
    1131                 cbChunk = RT_MIN(cbChunk, sizeof(g_abRTZero64K));
    1132                 cbChunk = PDMAudioPropsFloorBytesToFrame(&pStreamCC->State.Cfg.Props, cbChunk);
    1133 
    1134                 int rc2 = PDMDevHlpPCIPhysWrite(pDevIns, pRegs->bd.addr, g_abRTZero64K, cbChunk);
    1135                 AssertRC(rc2);
    1136             }
     1127            /* Since the format is signed 16-bit or 32-bit integer samples, we can
     1128               use g_abRTZero64K as source and avoid some unnecessary bzero() work. */
     1129            cbChunk = RT_MIN(cbChunk, sizeof(g_abRTZero64K));
     1130            cbChunk = PDMAudioPropsFloorBytesToFrame(&pStreamCC->State.Cfg.Props, cbChunk);
     1131
     1132            int rc2 = PDMDevHlpPCIPhysWrite(pDevIns, pRegs->bd.addr, g_abRTZero64K, cbChunk);
     1133            AssertRC(rc2);
    11371134        }
    11381135
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette