VirtualBox

Changeset 35427 in vbox for trunk/src


Ignore:
Timestamp:
Jan 7, 2011 2:09:52 PM (14 years ago)
Author:
vboxsync
Message:

Devices/Audio/filteraudio: do not call host backend voice uninit if the voice has not been initialized by the host (removed unnecessary parts of r69286).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/filteraudio.c

    r35419 r35427  
    334334
    335335    if (!pVoice->fIntercepted)
     336    {
    336337        return filter_conf.pDrv->pcm_ops->run_out(phw);
     338    }
    337339
    338340    /* We return the live count in the case we are not initialized. This should
     
    409411
    410412    status = ASMAtomicReadU32(&pVoice->status);
    411     if (status != CA_STATUS_INIT)
     413    if (!(status == CA_STATUS_INIT))
    412414        return 0;
    413415
     
    549551
    550552    /* Iterate as long as data is available */
    551     while (csWritten < csAvail)
     553    while(csWritten < csAvail)
    552554    {
    553555        /* How much is left? */
     
    664666    int rc = VINF_SUCCESS;
    665667    filterVoiceIn *pVoice;
    666     int rcHost = 0;
    667668
    668669    if (!filter_conf.pDrv)
     
    688689            /* Note: audio.c does not use variable parameters '...', so ok to forward only 'phw' and 'cmd'. */
    689690            Log(("FilterAudio: [Input]: forwarding ctl_in ENABLE for voice %p (hw %p)\n", pVoice, pVoice->phw));
    690             if (pVoice->fHostOK)
    691                 rcHost = filter_conf.pDrv->pcm_ops->ctl_in(phw, cmd);
    692             return rcHost;
     691            return filter_conf.pDrv->pcm_ops->ctl_in(phw, cmd);
    693692        }
    694693
     
    730729        if (!pVoice->fIntercepted)
    731730        {
     731            if (!pVoice->fHostOK)
     732            {
     733                /* Host did not initialize the voice. Theoretically should not happen, because
     734                 * audio.c should not disable a voice which has not been enabled at all.
     735                 */
     736                Log(("FilterAudio: [Input]: ctl_in DISABLE voice %p (hw %p) not available on host\n", pVoice, pVoice->phw));
     737                return -1;
     738            }
     739
    732740            /* Note: audio.c does not use variable parameters '...', so ok to forward only 'phw' and 'cmd'. */
    733741            Log(("FilterAudio: [Input]: forwarding ctl_in DISABLE for voice %p (hw %p)\n", pVoice, pVoice->phw));
    734             if (pVoice->fHostOK)
    735                 rcHost = filter_conf.pDrv->pcm_ops->ctl_in(phw, cmd);
    736             return rcHost;
     742            return filter_conf.pDrv->pcm_ops->ctl_in(phw, cmd);
    737743        }
    738744
     
    773779
    774780    /* Uninitialize both host and filter parts of the voice. */
    775     Log(("FilterAudio: [Input]: forwarding fini_in for voice %p (hw %p)\n", pVoice, pVoice->phw));
    776781    if (pVoice->fHostOK)
     782    {
     783        /* Uninit host part only if it was initialized by host. */
     784        Log(("FilterAudio: [Input]: forwarding fini_in for voice %p (hw %p)\n", pVoice, pVoice->phw));
    777785        filter_conf.pDrv->pcm_ops->fini_in(phw);
     786    }
    778787
    779788    Log(("FilterAudio: [Input]: fini_in for voice %p (hw %p)\n", pVoice, pVoice->phw));
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