src/audio/dart/SDL_dart.c
changeset 3011 8f4ed5ec2b06
parent 2859 99210400e8b9
child 3013 8cc00819c8d6
equal deleted inserted replaced
3010:a6694a812119 3011:8f4ed5ec2b06
    60                 SDL_AudioDevice *pSDLAudioDevice = pBufDesc->pSDLAudioDevice;
    60                 SDL_AudioDevice *pSDLAudioDevice = pBufDesc->pSDLAudioDevice;
    61                 // Set the buffer to be empty
    61                 // Set the buffer to be empty
    62                 pBufDesc->iBufferUsage = BUFFER_EMPTY;
    62                 pBufDesc->iBufferUsage = BUFFER_EMPTY;
    63                 // And notify DART feeder thread that it will have to work a bit.
    63                 // And notify DART feeder thread that it will have to work a bit.
    64                 if (pSDLAudioDevice)
    64                 if (pSDLAudioDevice)
    65                     DosPostEventSem(pSDLAudioDevice->
    65                     DosPostEventSem(pSDLAudioDevice->hidden->
    66                                     hidden->hevAudioBufferPlayed);
    66                                     hevAudioBufferPlayed);
    67             }
    67             }
    68         }
    68         }
    69     }
    69     }
    70     return TRUE;
    70     return TRUE;
    71 }
    71 }
   310 
   310 
   311     pBufDesc =
   311     pBufDesc =
   312         (pMixBufferDesc) _this->hidden->pMixBuffers[iFreeBuf].ulUserParm;
   312         (pMixBufferDesc) _this->hidden->pMixBuffers[iFreeBuf].ulUserParm;
   313     pBufDesc->iBufferUsage = BUFFER_USED;
   313     pBufDesc->iBufferUsage = BUFFER_USED;
   314     // Send it to DART to be queued
   314     // Send it to DART to be queued
   315     _this->hidden->MixSetupParms.pmixWrite(_this->hidden->
   315     _this->hidden->MixSetupParms.pmixWrite(_this->hidden->MixSetupParms.
   316                                            MixSetupParms.ulMixHandle,
   316                                            ulMixHandle,
   317                                            &(_this->
   317                                            &(_this->hidden->
   318                                              hidden->pMixBuffers[iFreeBuf]),
   318                                              pMixBuffers[iFreeBuf]), 1);
   319                                            1);
       
   320 
   319 
   321     _this->hidden->iLastPlayedBuf = iFreeBuf;
   320     _this->hidden->iLastPlayedBuf = iFreeBuf;
   322     iFreeBuf = (iFreeBuf + 1) % _this->hidden->iCurrNumBufs;
   321     iFreeBuf = (iFreeBuf + 1) % _this->hidden->iCurrNumBufs;
   323     _this->hidden->iNextFreeBuffer = iFreeBuf;
   322     _this->hidden->iNextFreeBuffer = iFreeBuf;
   324 }
   323 }
   332 
   331 
   333     if (_this) {
   332     if (_this) {
   334         if (_this->hidden) {
   333         if (_this->hidden) {
   335             iFreeBuf = _this->hidden->iNextFreeBuffer;
   334             iFreeBuf = _this->hidden->iNextFreeBuffer;
   336             pBufDesc =
   335             pBufDesc =
   337                 (pMixBufferDesc) _this->hidden->
   336                 (pMixBufferDesc) _this->hidden->pMixBuffers[iFreeBuf].
   338                 pMixBuffers[iFreeBuf].ulUserParm;
   337                 ulUserParm;
   339 
   338 
   340             if (pBufDesc) {
   339             if (pBufDesc) {
   341                 if (pBufDesc->iBufferUsage == BUFFER_EMPTY) {
   340                 if (pBufDesc->iBufferUsage == BUFFER_EMPTY) {
   342                     pResult = _this->hidden->pMixBuffers[iFreeBuf].pBuffer;
   341                     pResult = _this->hidden->pMixBuffers[iFreeBuf].pBuffer;
   343                     return pResult;
   342                     return pResult;