Disk audio target was using this->hidden->mixlen before we set it.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 07 Jul 2013 02:04:19 -0400
changeset 7366 38c6f26bb010
parent 7365 a3fc9175306d
child 7367 d6eabafa8776
Disk audio target was using this->hidden->mixlen before we set it.
src/audio/disk/SDL_diskaudio.c
--- a/src/audio/disk/SDL_diskaudio.c	Sun Jul 07 02:03:50 2013 -0400
+++ b/src/audio/disk/SDL_diskaudio.c	Sun Jul 07 02:04:19 2013 -0400
@@ -114,6 +114,10 @@
     }
     SDL_memset(this->hidden, 0, sizeof(*this->hidden));
 
+    this->hidden->mixlen = this->spec.size;
+    this->hidden->write_delay =
+        (envr) ? SDL_atoi(envr) : DISKDEFAULT_WRITEDELAY;
+
     /* Open the audio device */
     this->hidden->output = SDL_RWFromFile(fname, "wb");
     if (this->hidden->output == NULL) {
@@ -129,10 +133,6 @@
     }
     SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size);
 
-    this->hidden->mixlen = this->spec.size;
-    this->hidden->write_delay =
-        (envr) ? SDL_atoi(envr) : DISKDEFAULT_WRITEDELAY;
-
 #if HAVE_STDIO_H
     fprintf(stderr,
             "WARNING: You are using the SDL disk writer audio driver!\n"