SDL_os2audio.c (OS2_OpenDevice): change spec->samples assignment:

Original code assigned MCIMixSetup.ulSamplesPerSec value to it, but it
is just the freq... We now change spec->samples only either if it is 0
or we changed the frequency, by picking a default of ~46 ms at desired
frequency (code taken from SDL_audio.c:prepare_audiospec()).

With this, the crashes I have been experiencing are gone.
diff --git a/src/audio/os2/SDL_os2audio.c b/src/audio/os2/SDL_os2audio.c
index 7b83d24..f906e89 100644
--- a/src/audio/os2/SDL_os2audio.c
+++ b/src/audio/os2/SDL_os2audio.c
@@ -268,7 +268,9 @@
   MCI_BUFFER_PARMS      stMCIBuffer;
   ULONG                 ulRC;
   ULONG                 ulIdx;
+  BOOL                  new_freq;
 
+  new_freq = FALSE;
   SDL_zero(stMCIAmpOpen);
   SDL_zero(stMCIBuffer);
 
@@ -350,10 +352,12 @@
   if ( this->spec.freq < 8000 )
   {
     this->spec.freq = 8000;
+    new_freq = TRUE;
   }
   else if ( this->spec.freq > 48000 )
   {
     this->spec.freq = 48000;
+    new_freq = TRUE;
   }
 
   // Setup mixer.
@@ -377,6 +381,7 @@
                      MCI_WAIT | MCI_MIXSETUP_INIT, &pAData->stMCIMixSetup, 0 );
   if ( ( ulRC != MCIERR_SUCCESS ) && ( this->spec.freq > 44100 ) )
   {
+    new_freq = TRUE;
     pAData->stMCIMixSetup.ulSamplesPerSec = 44100;
     this->spec.freq = 44100;
     ulRC = mciSendCommand( pAData->usDeviceId, MCI_MIXSETUP,
@@ -395,13 +400,22 @@
     return _MCIError( "MCI_MIXSETUP", ulRC );
   }
 
-  this->spec.samples = pAData->stMCIMixSetup.ulSamplesPerSec;
+  if (this->spec.samples == 0 || new_freq == TRUE) {
+  /* also see SDL_audio.c:prepare_audiospec() */
+  /* Pick a default of ~46 ms at desired frequency */
+    Uint32 samples = (this->spec.freq / 1000) * 46;
+    Uint32 power2 = 1;
+    while (power2 < samples) {
+      power2 <<= 1;
+    }
+    this->spec.samples = power2;
+  }
   /* Update the fragment size as size in bytes */
   SDL_CalculateAudioSpec( &this->spec );
 
   // Allocate memory buffers
 
-  stMCIBuffer.ulBufferSize = (this->spec.freq / 1000) * 100;// this->spec.size;
+  stMCIBuffer.ulBufferSize = this->spec.size;// (this->spec.freq / 1000) * 100;
   stMCIBuffer.ulNumBuffers = NUM_BUFFERS;
   stMCIBuffer.pBufList     = &pAData->aMixBuffers;