Changeset 153 for sbliveos2/trunk/drv16/wavestrm.cpp
- Timestamp:
- Jul 23, 2000, 6:21:57 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sbliveos2/trunk/drv16/wavestrm.cpp
r152 r153 167 167 } 168 168 space = OSS16_StreamGetSpace(this); 169 if(space > 128) {170 space -= 128;171 }172 169 while(space) { 173 170 byteswritten = AddBuffer(space); … … 186 183 ULONG WAVESTREAM::AddBuffer(ULONG space) 187 184 { 188 PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhDone. Head();185 PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhDone.Tail(); 189 186 ULONG pdataBuf; 190 187 ULONG Buff_left, byteswritten; … … 193 190 pTemp = (PSTREAMBUFFER)qhInProcess.Head(); 194 191 } 195 if(!pTemp) return 0; 192 if(!pTemp) { 193 dprintf4(("AddBuffer: pTemp == NULL")); 194 return 0; 195 } 196 196 197 197 // get the buffer pointer and amount of data remaining … … 209 209 pTemp->ulBuffpos += byteswritten; 210 210 211 if (!qhDone.Head() || pTemp != qhDone.Head()) {212 qhDone.PushOnTail(qhInProcess.PopHead());211 if(pTemp != qhDone.Tail()) { 212 qhDone.PushOnTail(qhInProcess.PopHead()); 213 213 } 214 214 dprintf4(("AddBuffer %lx size %d, bytes written %d", pdataBuf, (USHORT)Buff_left, (USHORT)byteswritten)); … … 221 221 BOOL WAVESTREAM::_vReadAudioBuf(void) 222 222 { 223 PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qh Done.Head();223 PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhInProcess.Head(); 224 224 ULONG pdataBuf; 225 225 ULONG Buff_left, bytesread; 226 226 227 if(!pTemp || pTemp->ulBuffpos >= (pTemp->ulBuffsz & 0xFFFFFFFC)) {228 pTemp = (PSTREAMBUFFER)qhInProcess.Head();229 }230 227 if(!pTemp) return FALSE; 231 228 … … 246 243 _ulBytesProcessed += bytesread; 247 244 248 if (!qhDone.Head() || pTemp != qhDone.Head()) {245 if(pTemp->ulBuffpos == pTemp->ulBuffsz) { 249 246 qhDone.PushOnTail(qhInProcess.PopHead()); 250 } 251 if(pTemp->ulBuffpos == pTemp->ulBuffsz) { 247 ReturnBuffer(); 252 248 dprintf4(("_vReadAudioBuf return buffer %lx size %ld, bytes read %ld", (ULONG)pTemp->pBuffptr, pTemp->ulBuffsz, bytesread)); 253 ReturnBuffer();254 249 } 255 250 … … 277 272 } 278 273 bytesinc = ulCurBytesProcessed - _ulBytesProcessed; 274 dprintf4(("Process: %lx %x", ulCurBytesProcessed, (USHORT)bytesinc)); 279 275 if(ulCurBytesProcessed < _ulBytesProcessed) { 280 276 dprintf(("WARNING: Process: Current pos %ld incr %d", ulCurBytesProcessed, (USHORT)bytesinc)); … … 396 392 { 397 393 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 404 396 // configure the wave device 405 397 ((PWAVEAUDIO)pahw)->ConfigDev(this, &_configinfo); … … 439 431 OSS16_StartStream(this); 440 432 } 441 #ifdef DEBUG442 dbglevel = oldlevel;443 #endif444 433 445 434 //Must set volume after adding buffers (voices inside sblive driver might not … … 540 529 _ulBytesProcessed = 0; 541 530 _ulTimeBase = 0; 531 542 532 fUnderrun = FALSE; 543 533
Note:
See TracChangeset
for help on using the changeset viewer.