VirtualBox

Changeset 87998 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Mar 8, 2021 1:20:54 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143121
Message:

Audio: nits. bugref:9890

File:
1 edited

Legend:

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

    r87997 r87998  
    8585
    8686/**
    87  * Retrieves the matching PDMAUDIOFMT for given bits + signing flag.
    88  *
    89  * @return  IPRT status code.
    90  * @return  PDMAUDIOFMT         Resulting audio format or PDMAUDIOFMT_INVALID if invalid.
    91  * @param   cBits               Bits to retrieve audio format for.
    92  * @param   fSigned             Signed flag for bits to retrieve audio format for.
    93  */
    94 PDMAUDIOFMT DrvAudioAudFmtBitsToAudFmt(uint8_t cBits, bool fSigned)
     87 * Retrieves the matching PDMAUDIOFMT for the given bits + signing flag.
     88 *
     89 * @return  Matching PDMAUDIOFMT value.
     90 * @retval  PDMAUDIOFMT_INVALID if unsupported @a cBits value.
     91 *
     92 * @param   cBits       The number of bits in the audio format.
     93 * @param   fSigned     Whether the audio format is signed @c true or not.
     94 */
     95PDMAUDIOFMT DrvAudioAudFmtBitsToFormat(uint8_t cBits, bool fSigned)
    9596{
    9697    if (fSigned)
     
    101102            case 16: return PDMAUDIOFMT_S16;
    102103            case 32: return PDMAUDIOFMT_S32;
    103             default: break;
     104            default: AssertMsgFailedReturn(("Bogus audio bits %RU8\n", cBits), PDMAUDIOFMT_INVALID);
    104105        }
    105106    }
     
    111112            case 16: return PDMAUDIOFMT_U16;
    112113            case 32: return PDMAUDIOFMT_U32;
    113             default: break;
    114         }
    115     }
    116 
    117     AssertMsgFailed(("Bogus audio bits %RU8\n", cBits));
    118     return PDMAUDIOFMT_INVALID;
     114            default: AssertMsgFailedReturn(("Bogus audio bits %RU8\n", cBits), PDMAUDIOFMT_INVALID);
     115        }
     116    }
    119117}
    120118
     
    789787    if (!RTStrICmp(pszFmt, "u8"))
    790788        return PDMAUDIOFMT_U8;
    791     else if (!RTStrICmp(pszFmt, "u16"))
     789    if (!RTStrICmp(pszFmt, "u16"))
    792790        return PDMAUDIOFMT_U16;
    793     else if (!RTStrICmp(pszFmt, "u32"))
     791    if (!RTStrICmp(pszFmt, "u32"))
    794792        return PDMAUDIOFMT_U32;
    795     else if (!RTStrICmp(pszFmt, "s8"))
     793    if (!RTStrICmp(pszFmt, "s8"))
    796794        return PDMAUDIOFMT_S8;
    797     else if (!RTStrICmp(pszFmt, "s16"))
     795    if (!RTStrICmp(pszFmt, "s16"))
    798796        return PDMAUDIOFMT_S16;
    799     else if (!RTStrICmp(pszFmt, "s32"))
     797    if (!RTStrICmp(pszFmt, "s32"))
    800798        return PDMAUDIOFMT_S32;
    801799
Note: See TracChangeset for help on using the changeset viewer.

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