VirtualBox

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


Ignore:
Timestamp:
Jun 1, 2021 8:58:25 PM (4 years ago)
Author:
vboxsync
Message:

DrvAudio: Use pStreamEx->Core.Props instead of pStream->Guest.Cfg.Props and pStream->Host.Cfg.Props. The former is actually very wrong as it's what the mixer requested, not the actual properties of the stream. bugref:9890

File:
1 edited

Legend:

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

    r89412 r89445  
    34253425
    34263426        /* Make sure to align the writable size to the host's frame size. */
    3427         cbWritable = PDMAudioPropsFloorBytesToFrame(&pStreamEx->Host.Cfg.Props, cbWritable);
     3427        cbWritable = PDMAudioPropsFloorBytesToFrame(&pStreamEx->Core.Props, cbWritable);
    34283428    }
    34293429
     
    34313431    RTCritSectLeave(&pStreamEx->Core.CritSect);
    34323432    Log3Func(("[%s] cbWritable=%#RX32 (%RU64ms) enmPlayMode=%s enmBackendState=%s\n",
    3433               pStreamEx->Core.szName, cbWritable, PDMAudioPropsBytesToMilli(&pStreamEx->Host.Cfg.Props, cbWritable),
     3433              pStreamEx->Core.szName, cbWritable, PDMAudioPropsBytesToMilli(&pStreamEx->Core.Props, cbWritable),
    34343434              drvAudioPlayStateName(enmPlayMode), PDMHostAudioStreamStateGetName(enmBackendState) ));
    34353435    return cbWritable;
     
    34663466                     pStreamEx->Core.szName, PDMAudioDirGetName(pStreamEx->Core.enmDir)), VERR_ACCESS_DENIED);
    34673467
    3468     AssertMsg(PDMAudioPropsIsSizeAligned(&pStreamEx->Guest.Cfg.Props, cbBuf),
     3468    AssertMsg(PDMAudioPropsIsSizeAligned(&pStreamEx->Core.Props, cbBuf),
    34693469              ("Stream '%s' got a non-frame-aligned write (%#RX32 bytes)\n", pStreamEx->Core.szName, cbBuf));
    34703470
     
    36203620            {
    36213621                uint64_t const cNsStream = RTTimeNanoTS() - pStreamEx->nsStarted;
    3622                 uint64_t const offCur    = PDMAudioPropsNanoToBytes64(&pStreamEx->Guest.Cfg.Props, cNsStream);
     3622                uint64_t const offCur    = PDMAudioPropsNanoToBytes64(&pStreamEx->Core.Props, cNsStream);
    36233623                if (offCur > pStreamEx->offInternal)
    36243624                {
     
    36393639
    36403640        /* Make sure to align the readable size to the host's frame size. */
    3641         cbReadable = PDMAudioPropsFloorBytesToFrame(&pStreamEx->Host.Cfg.Props, cbReadable);
     3641        cbReadable = PDMAudioPropsFloorBytesToFrame(&pStreamEx->Core.Props, cbReadable);
    36423642    }
    36433643
     
    36453645    RTCritSectLeave(&pStreamEx->Core.CritSect);
    36463646    Log3Func(("[%s] cbReadable=%#RX32 (%RU64ms) enmCaptureMode=%s enmBackendState=%s\n",
    3647               pStreamEx->Core.szName, cbReadable, PDMAudioPropsBytesToMilli(&pStreamEx->Host.Cfg.Props, cbReadable),
     3647              pStreamEx->Core.szName, cbReadable, PDMAudioPropsBytesToMilli(&pStreamEx->Core.Props, cbReadable),
    36483648              drvAudioCaptureStateName(enmCaptureState), PDMHostAudioStreamStateGetName(enmBackendState) ));
    36493649    return cbReadable;
     
    36673667    /** @todo  Does not take paused time into account...  */
    36683668    uint64_t const cNsStream = RTTimeNanoTS() - pStreamEx->nsStarted;
    3669     uint64_t const offCur    = PDMAudioPropsNanoToBytes64(&pStreamEx->Guest.Cfg.Props, cNsStream);
     3669    uint64_t const offCur    = PDMAudioPropsNanoToBytes64(&pStreamEx->Core.Props, cNsStream);
    36703670    if (offCur > pStreamEx->offInternal)
    36713671    {
     
    36753675        pStreamEx->offInternal  += cbToClear;
    36763676        cbBuf                   -= cbToClear;
    3677         PDMAudioPropsClearBuffer(&pStreamEx->Guest.Cfg.Props, pbBuf, cbToClear,
    3678                                  PDMAudioPropsBytesToFrames(&pStreamEx->Guest.Cfg.Props, cbToClear));
     3677        PDMAudioPropsClearBuffer(&pStreamEx->Core.Props, pbBuf, cbToClear,
     3678                                 PDMAudioPropsBytesToFrames(&pStreamEx->Core.Props, cbToClear));
    36793679    }
    36803680    else
     
    37693769                     pStreamEx->Core.szName, PDMAudioDirGetName(pStreamEx->Core.enmDir)), VERR_ACCESS_DENIED);
    37703770
    3771     AssertMsg(PDMAudioPropsIsSizeAligned(&pStreamEx->Guest.Cfg.Props, cbBuf),
     3771    AssertMsg(PDMAudioPropsIsSizeAligned(&pStreamEx->Core.Props, cbBuf),
    37723772              ("Stream '%s' got a non-frame-aligned write (%#RX32 bytes)\n", pStreamEx->Core.szName, cbBuf));
    37733773
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