src/audio/directsound/SDL_directsound.c
changeset 10257 757db914bde0
parent 10239 f17581d00c26
child 10260 1e7b4cfe8451
--- a/src/audio/directsound/SDL_directsound.c	Tue Aug 09 16:58:32 2016 -0400
+++ b/src/audio/directsound/SDL_directsound.c	Tue Aug 09 19:35:46 2016 -0400
@@ -361,9 +361,6 @@
     wfmt.nBlockAlign = wfmt.nChannels * (wfmt.wBitsPerSample / 8);
     wfmt.nAvgBytesPerSec = wfmt.nSamplesPerSec * wfmt.nBlockAlign;
 
-    /* Update the fragment size as size in bytes */
-    SDL_CalculateAudioSpec(&this->spec);
-
     /* Try to set primary mixing privileges */
     if (focus) {
         result = IDirectSound_SetCooperativeLevel(sndObj,
@@ -447,6 +444,8 @@
         case AUDIO_F32:
             tried_format = SDL_TRUE;
             this->spec.format = test_format;
+            /* Update the fragment size as size in bytes */
+            SDL_CalculateAudioSpec(&this->spec);
             this->hidden->num_buffers = CreateSecondary(this, NULL);
             if (this->hidden->num_buffers > 0) {
                 valid_format = SDL_TRUE;