Ignore:
Timestamp:
Jul 23, 2000, 6:21:57 PM (25 years ago)
Author:
sandervl
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sbliveos2/trunk/drv16/wavestrm.cpp

    r152 r153  
    167167        }
    168168        space = OSS16_StreamGetSpace(this);
    169         if(space > 128) {
    170                 space -= 128;
    171         }
    172169        while(space) {
    173170                byteswritten = AddBuffer(space);
     
    186183ULONG WAVESTREAM::AddBuffer(ULONG space)
    187184{
    188    PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhDone.Head();
     185   PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhDone.Tail();
    189186   ULONG pdataBuf;
    190187   ULONG Buff_left, byteswritten;
     
    193190        pTemp = (PSTREAMBUFFER)qhInProcess.Head();
    194191   }
    195    if(!pTemp) return 0;
     192   if(!pTemp) {
     193        dprintf4(("AddBuffer: pTemp == NULL"));
     194        return 0;
     195   }
    196196
    197197   // get the buffer pointer and amount of data remaining
     
    209209   pTemp->ulBuffpos += byteswritten;
    210210
    211    if (!qhDone.Head() || pTemp != qhDone.Head()) {
    212       qhDone.PushOnTail(qhInProcess.PopHead());
     211   if(pTemp != qhDone.Tail()) {
     212        qhDone.PushOnTail(qhInProcess.PopHead());
    213213   }
    214214   dprintf4(("AddBuffer %lx size %d, bytes written %d", pdataBuf, (USHORT)Buff_left, (USHORT)byteswritten));
     
    221221BOOL WAVESTREAM::_vReadAudioBuf(void)
    222222{
    223    PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhDone.Head();
     223   PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhInProcess.Head();
    224224   ULONG pdataBuf;
    225225   ULONG Buff_left, bytesread;
    226226
    227    if(!pTemp || pTemp->ulBuffpos >= (pTemp->ulBuffsz & 0xFFFFFFFC)) {
    228         pTemp = (PSTREAMBUFFER)qhInProcess.Head();
    229    }
    230227   if(!pTemp) return FALSE;
    231228
     
    246243   _ulBytesProcessed += bytesread;
    247244
    248    if (!qhDone.Head() || pTemp != qhDone.Head()) {
     245   if(pTemp->ulBuffpos == pTemp->ulBuffsz) {
    249246        qhDone.PushOnTail(qhInProcess.PopHead());
    250    }
    251    if(pTemp->ulBuffpos == pTemp->ulBuffsz) {
     247        ReturnBuffer();
    252248        dprintf4(("_vReadAudioBuf return buffer %lx size %ld, bytes read %ld", (ULONG)pTemp->pBuffptr, pTemp->ulBuffsz, bytesread));
    253         ReturnBuffer();
    254249   }
    255250
     
    277272        }
    278273        bytesinc           = ulCurBytesProcessed - _ulBytesProcessed;
     274        dprintf4(("Process: %lx %x", ulCurBytesProcessed, (USHORT)bytesinc));
    279275        if(ulCurBytesProcessed < _ulBytesProcessed) {
    280276                dprintf(("WARNING: Process: Current pos %ld incr %d", ulCurBytesProcessed, (USHORT)bytesinc));
     
    396392{
    397393 PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhInProcess.Head();
    398  ULONG         fragsize;
    399 
    400 #ifdef DEBUG
    401    int oldlevel = dbglevel;
    402    dbglevel = 4;
    403 #endif
     394 ULONG fragsize;
     395
    404396   // configure the wave device
    405397   ((PWAVEAUDIO)pahw)->ConfigDev(this, &_configinfo);
     
    439431        OSS16_StartStream(this);
    440432   }
    441 #ifdef DEBUG
    442    dbglevel = oldlevel;
    443 #endif
    444433
    445434   //Must set volume after adding buffers (voices inside sblive driver might not
     
    540529   _ulBytesProcessed = 0;
    541530   _ulTimeBase = 0;
     531
    542532   fUnderrun = FALSE;
    543533
Note: See TracChangeset for help on using the changeset viewer.