VirtualBox

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


Ignore:
Timestamp:
Jun 16, 2021 1:48:45 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145193
Message:

DevIchAc97: Addressed todo in ichac97R3StreamSetUp regarding zero rate, making it return VERR_OUT_OF_RANGE rather than VINF_SUCCESS and check for any unsupported uHz values. bugref:9890

File:
1 edited

Legend:

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

    r89739 r89742  
    20382038    }
    20392039
    2040     /** @todo r=bird: If uHz == 0 then we'll just keep the previous stream, so
    2041      * wonder how that's going to play out if the guest tries to enable it...  This
    2042      * makes no real sense.
    2043      *
    2044      * Comment your code and changes you make, please!  This is frigging tedious.
    2045      *
    2046      * Test added in r127402?  The test is older (before r118166, r113296, r112652,
    2047      * r112463, r107142), but it used to be placed after calling
    2048      * ichac97R3MixerRemoveDrvStreams() since r112652.  Till ~r112463 a zero uHz
    2049      * caused a VERR_INVALID_PARAMETER return. Before r107142 it would disable the
    2050      * stream if uHz was zero. */
    2051     if (Cfg.Props.uHz)
    2052     { /* likely */ }
    2053     else
    2054     {
    2055         LogFlowFunc(("[SD%RU8] Hz is zero!! skipping/ignoring\n", pStreamCC->u8SD));
    2056         return VINF_SUCCESS;
    2057     }
     2040    /*
     2041     * Don't continue if the frequency is out of range (the rest of the
     2042     * properties should be okay).
     2043     */
     2044    char szTmp[PDMAUDIOSTRMCFGTOSTRING_MAX];
     2045    ASSERT_GUEST_MSG_RETURN(AudioHlpStreamCfgIsValid(&Cfg),
     2046                            ("Invalid stream #%u rate: %s\n", pStreamCC->u8SD,
     2047                             PDMAudioStrmCfgToString(&Cfg, szTmp, sizeof(szTmp)) ),
     2048                            VERR_INVALID_PARAMETER);
    20582049
    20592050    /*
     
    21232114        if (Cfg.Props.uHz > 44100) /* E.g. 48000 Hz. */
    21242115            uTimerHz = 200;
    2125         else /* Just take the global Hz rate otherwise. */
    2126             uTimerHz = pThis->uTimerHz;
     2116        else
     2117            uTimerHz = AC97_TIMER_HZ_DEFAULT;
    21272118    }
    21282119    else
     
    22052196     * Otherwise avoid this and just reuse it, as this costs performance.
    22062197     */
    2207     char szTmp[PDMAUDIOSTRMCFGTOSTRING_MAX];
    22082198    int rc = VINF_SUCCESS;
    22092199    if (   fForce
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