VirtualBox

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


Ignore:
Timestamp:
Dec 16, 2019 7:06:10 PM (5 years ago)
Author:
vboxsync
Message:

Audio/HDA: Initialize stream direction and source / destination in hdaR3StreamConstruct().

File:
1 edited

Legend:

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

    r82566 r82599  
    9090#endif
    9191
     92    const bool fIsInput = hdaGetDirFromSD(uSD) == PDMAUDIODIR_IN;
     93
     94    if (fIsInput)
     95    {
     96        pStreamShared->State.Cfg.u.enmSrc = PDMAUDIORECSRC_UNKNOWN;
     97        pStreamShared->State.Cfg.enmDir   = PDMAUDIODIR_IN;
     98    }
     99    else
     100    {
     101        pStreamShared->State.Cfg.u.enmDst = PDMAUDIOPLAYBACKDST_UNKNOWN;
     102        pStreamShared->State.Cfg.enmDir   = PDMAUDIODIR_OUT;
     103    }
     104
    92105    pStreamR3->Dbg.Runtime.fEnabled = pThisCC->Dbg.fEnabled;
    93106
     
    98111
    99112        /* pFileStream */
    100         if (hdaGetDirFromSD(uSD) == PDMAUDIODIR_IN)
     113        if (fIsInput)
    101114            RTStrPrintf(szFile, sizeof(szFile), "hdaStreamWriteSD%RU8", uSD);
    102115        else
     
    111124
    112125        /* pFileDMARaw */
    113         if (hdaGetDirFromSD(uSD) == PDMAUDIODIR_IN)
     126        if (fIsInput)
    114127            RTStrPrintf(szFile, sizeof(szFile), "hdaDMARawWriteSD%RU8", uSD);
    115128        else
     
    124137
    125138        /* pFileDMAMapped */
    126         if (hdaGetDirFromSD(uSD) == PDMAUDIODIR_IN)
     139        if (fIsInput)
    127140            RTStrPrintf(szFile, sizeof(szFile), "hdaDMAWriteMappedSD%RU8", uSD);
    128141        else
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