Ignore:
Timestamp:
May 6, 2010, 3:08:34 AM (15 years ago)
Author:
David Azarewicz
Message:

Rework buffer management

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OCO/trunk/drv16/stream.cpp

    r468 r483  
    4646   PSTREAMBUFFER temp = (PSTREAMBUFFER)qhDone.PopHead();
    4747
    48    if (temp) 
     48   if (temp)
    4949   {
    5050            shdri.ulFunction = SHD_REPORT_INT;
     
    5252        // if this is a write (playback) then set the streamtype and
    5353        // tell the stream handler that we played all of the buffer.
    54         if (ulStreamType & STREAM_WRITE) 
    55        {
     54        if (ulStreamType & STREAM_WRITE)
     55        {
    5656                shdri.ulFlag = SHD_WRITE_COMPLETE;
    5757                shdri.ulStatus = temp->ulBuffsz;
     
    6666        shdri.pBuffer = temp->pBuffptr;
    6767        shdri.ulStreamTime = GetCurrentTime();
     68                //ddprintf(("Returning %lx Time=%lx", temp->pBuffptr, shdri.ulStreamTime));
    6869        pfnSHD(&shdri);
    6970        delete temp;
     
    9495//SvL: BUGFIX: check all events
    9596#if 1
    96    if (qhEvent.IsElements()) {
    97         PEVENT pnextevent = (PEVENT)qhEvent.Head();
    98         ULONG  time = GetCurrentTime();
    99         while(pnextevent) {
    100                 ULONG eventtime = pnextevent->GetEventTime();
    101                 if (eventtime <= time)
    102                         pnextevent->Report(time);
    103                 pnextevent = (PEVENT)pnextevent->pNext;
     97        if (qhEvent.IsElements()) {
     98                PEVENT pnextevent = (PEVENT)qhEvent.Head();
     99                ULONG  time = GetCurrentTime();
     100                while(pnextevent) {
     101                        ULONG eventtime = pnextevent->GetEventTime();
     102                        if (eventtime <= time)
     103                                pnextevent->Report(time);
     104                        pnextevent = (PEVENT)pnextevent->pNext;
     105                }
    104106        }
    105    }
    106107#else
    107108   if (qhEvent.IsElements()) {
     
    173174ULONG STREAM::Register(PDDCMDREGISTER p)
    174175{
    175    ddprintf(("STREAM::Register"));
     176//   ddprintf(("STREAM::Register"));
    176177   hstream             = p->hStream;
    177178   pfnSHD              = (PFN_SHD) p->pSHDEntryPoint;
     
    236237   // event to time out.. if it is not already on
    237238   // the head of the Event queue then put it there
    238    if (pele2 != qhEvent.Head()) 
     239   if (pele2 != qhEvent.Head())
    239240   {
    240241      cli();
     
    328329//******************************************************************************
    329330//******************************************************************************
    330 ULONG STREAM::GetProperty(int type) 
     331ULONG STREAM::GetProperty(int type)
    331332{
    332333   switch(type) {
     
    358359}
    359360//******************************************************************************
    360 static int streamtype[STREAM_MAX_TYPES] = {STREAM_WAVE_CAPTURE, STREAM_WAVE_PLAY, 
     361static int streamtype[STREAM_MAX_TYPES] = {STREAM_WAVE_CAPTURE, STREAM_WAVE_PLAY,
    361362                                           STREAM_MPU401_CAPTURE,
    362363                                           STREAM_MPU401_PLAY, STREAM_FMSYNTH_PLAY};
Note: See TracChangeset for help on using the changeset viewer.