Changeset 473 for OCO/trunk/drv16/wavestrm.cpp
- Timestamp:
- Nov 9, 2009, 2:36:35 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OCO/trunk/drv16/wavestrm.cpp
r468 r473 181 181 } 182 182 space &= (~(_configinfo.ulSampleSize - 1)); 183 curspace = space;183 curspace = min(space, _configinfo.ulBytesPerIRQ/_configinfo.ulSampleSize * 2); 184 184 while (space && qhInProcess.IsElements()) 185 185 { … … 188 188 if (fFirst == TRUE) //PS+++ 189 189 { 190 DevHelp_ProcBlock (space, 20, 0); 190 cli(); 191 // DevHelp_ProcBlock (space, 20, 0); 191 192 } 192 193 // dgprintf(("AddBuffers write %ld SSize:%ld %d",space, _configinfo.ulSampleSize, fFirst == TRUE?1:2)); … … 195 196 { 196 197 // dgprintf(("WAVESTREAM::AddBuffers Error 2")); 197 return;198 break; 198 199 } 199 200 if(byteswritten == (ULONG)-1) … … 233 234 if(pahw->GetHwPtr(StreamId, &_configinfo, &start_pos) == FALSE) 234 235 { 235 dgprintf(("WAVESTREAM::AddBuffer Err or in WaveGetHwPtr"));236 dgprintf(("WAVESTREAM::AddBuffer Err in GetHwPtr")); 236 237 DebugInt3(); 237 238 return (ULONG)-1; … … 240 241 if (!pTemp->ulBuffsz || !space) 241 242 { 242 dgprintf(("WAVESTREAM::AddBuffer NULL, Bufsz:%ld Space:%ld",pTemp->ulBuffsz, space));243 dgprintf(("WAVESTREAM::AddBuffer 0, Bufsz:%ld Space:%ld",pTemp->ulBuffsz, space)); 243 244 //PS+++ if is ZERO do nothing and ask for give new buffer, See REMARK in mmpm2.inf 244 245 qhDone.PushOnTail(qhInProcess.PopHead()); 245 246 // DebugInt3(); 246 return 0;247 return -1; 247 248 } 248 249 // get the buffer pointer and amount of data remaining … … 261 262 dgprintf(("AddBuffer: No more room!!")); 262 263 // DebugInt3(); 263 return (ULONG)-1; //no more room 264 //PS+++ return (ULONG)-1; //no more room 265 return 0; //PS+++ may be in next time? 264 266 } 265 267 // update the buffer pos counter … … 304 306 } 305 307 306 dprintf4(("_vReadAudioBuf %lx size %ld, bytes read %ld", pdataBuf, Buff_left, bytesread));308 // dprintf4(("_vReadAudioBuf %lx size %ld, bytes read %ld", pdataBuf, Buff_left, bytesread)); 307 309 308 310 // update the buffer pos counter … … 325 327 // can be returned and finally process any events pending. 326 328 //****************************************************************************** 327 //USHORT ProcNumber = 0;329 USHORT ProcNumber = 0; 328 330 void DBGCALLCONV WAVESTREAM::Process(void) 329 331 { 330 332 PSTREAMBUFFER ptemp; 331 333 ULONG ulCurBytesProcessed = 0; 332 //USHORT CurProcNumber = ProcNumber++;334 USHORT CurProcNumber = ProcNumber++; 333 335 ULONG space; 334 336 … … 351 353 _ulBytesProcessed = ulCurBytesProcessed; 352 354 353 // if ((pahw->GetSpace(StreamId, &_configinfo, &space) != FALSE) && (space > _configinfo.ulBytesPerIRQ)) 354 switch (ulStreamType & STREAM_WRITE) { 355 if ((pahw->GetSpace(StreamId, &_configinfo, &space) != FALSE) && (space > _configinfo.ulBytesPerIRQ/_configinfo.ulSampleSize )) 356 switch (ulStreamType & STREAM_WRITE) 357 { 355 358 356 359 // if there are buffers that have been completly written to the audio buffer … … 522 525 523 526 #ifdef DEBUG 524 ddprintf(("WAVESTREAM::StartStream"));527 // ddprintf(("WAVESTREAM::StartStream")); 525 528 #endif 526 529 … … 572 575 } 573 576 } 574 ddprintf(("WAVESTREAM::StartStream %lx End", StreamId));577 // ddprintf(("WAVESTREAM::StartStream %lx End", StreamId)); 575 578 return NO_ERROR; 576 579 … … 598 601 599 602 ulStreamState = STREAM_STOPPED; 600 ddprintf(("WAVESTREAM::StopStream %lx", StreamId));603 // ddprintf(("WAVESTREAM::StopStream %lx", StreamId)); 601 604 ReturnBuffers(); 602 605 pControl->ulTime = GetCurrentTime();
Note:
See TracChangeset
for help on using the changeset viewer.