src/audio/directsound/SDL_directsound.c
changeset 10257 757db914bde0
parent 10239 f17581d00c26
child 10260 1e7b4cfe8451
equal deleted inserted replaced
10256:cc6461b9c5bc 10257:757db914bde0
   359     wfmt.nChannels = this->spec.channels;
   359     wfmt.nChannels = this->spec.channels;
   360     wfmt.nSamplesPerSec = this->spec.freq;
   360     wfmt.nSamplesPerSec = this->spec.freq;
   361     wfmt.nBlockAlign = wfmt.nChannels * (wfmt.wBitsPerSample / 8);
   361     wfmt.nBlockAlign = wfmt.nChannels * (wfmt.wBitsPerSample / 8);
   362     wfmt.nAvgBytesPerSec = wfmt.nSamplesPerSec * wfmt.nBlockAlign;
   362     wfmt.nAvgBytesPerSec = wfmt.nSamplesPerSec * wfmt.nBlockAlign;
   363 
   363 
   364     /* Update the fragment size as size in bytes */
       
   365     SDL_CalculateAudioSpec(&this->spec);
       
   366 
       
   367     /* Try to set primary mixing privileges */
   364     /* Try to set primary mixing privileges */
   368     if (focus) {
   365     if (focus) {
   369         result = IDirectSound_SetCooperativeLevel(sndObj,
   366         result = IDirectSound_SetCooperativeLevel(sndObj,
   370                                                   focus, DSSCL_PRIORITY);
   367                                                   focus, DSSCL_PRIORITY);
   371     } else {
   368     } else {
   445         case AUDIO_S16:
   442         case AUDIO_S16:
   446         case AUDIO_S32:
   443         case AUDIO_S32:
   447         case AUDIO_F32:
   444         case AUDIO_F32:
   448             tried_format = SDL_TRUE;
   445             tried_format = SDL_TRUE;
   449             this->spec.format = test_format;
   446             this->spec.format = test_format;
       
   447             /* Update the fragment size as size in bytes */
       
   448             SDL_CalculateAudioSpec(&this->spec);
   450             this->hidden->num_buffers = CreateSecondary(this, NULL);
   449             this->hidden->num_buffers = CreateSecondary(this, NULL);
   451             if (this->hidden->num_buffers > 0) {
   450             if (this->hidden->num_buffers > 0) {
   452                 valid_format = SDL_TRUE;
   451                 valid_format = SDL_TRUE;
   453             }
   452             }
   454             break;
   453             break;