diff --git a/src/audio/disk/SDL_diskaudio.c b/src/audio/disk/SDL_diskaudio.c index 89687ed18..2286ba095 100644 --- a/src/audio/disk/SDL_diskaudio.c +++ b/src/audio/disk/SDL_diskaudio.c @@ -114,6 +114,10 @@ DISKAUD_OpenDevice(_THIS, const char *devname, int iscapture) } 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 @@ DISKAUD_OpenDevice(_THIS, const char *devname, int iscapture) } 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"