VirtualBox

Changeset 25768 in vbox


Ignore:
Timestamp:
Jan 12, 2010 2:19:08 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56525
Message:

Devices/pulseaudio: protect against killing the pulseaudio daemon during record

File:
1 edited

Legend:

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

    r25738 r25768  
    278278    if (fIn)
    279279    {
    280         LogRel(("Pulse: Obtained buffer attributes for recording: maxlength=%d fragsize=%d\n",
     280        LogRel(("Pulse:  Obtained record buffer attributes: maxlength=%d fragsize=%d\n",
    281281            pBufAttr->maxlength, pBufAttr->fragsize));
    282282    }
    283283    else
    284284    {
    285         LogRel(("Pulse: Obtained buffer attributes for playback: maxlength=%d tlength=%d prebuf=%d minreq=%d\n",
     285        LogRel(("Pulse:  Obtained playback buffer attributes: maxlength=%d tlength=%d prebuf=%d minreq=%d\n",
    286286            pBufAttr->maxlength, pBufAttr->tlength, pBufAttr->prebuf, pBufAttr->minreq));
    287287    }
     
    556556    pa_threaded_mainloop_unlock(g_pMainLoop);
    557557
     558    if (cFramesAvail == -1)
     559    {
     560        if (pPulse->cErrors < MAX_LOG_REL_ERRORS)
     561        {
     562            int rc = pa_context_errno(g_pContext);
     563            pPulse->cErrors++;
     564            LogRel(("Pulse: Failed to determine the readable size: %s\n",
     565                     pa_strerror(rc)));
     566        }
     567        return 0;
     568    }
     569
    558570    /* If the buffer was not dropped last call, add what remains */
    559571    if (pPulse->pu8PeekBuf)
     
    570582            pa_threaded_mainloop_unlock(g_pMainLoop);
    571583            pPulse->offPeekBuf = 0;
    572             if (!pPulse->cbPeekBuf)
     584            if (   !pPulse->pu8PeekBuf
     585                || !pPulse->cbPeekBuf)
    573586                break;
    574587        }
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