# HG changeset patch # User reimar # Date 1354484689 0 # Node ID f2a11c8695a4a0520b959672231b40552a30e877 # Parent 116dbb38eac0bbdfd7ec2cf12b0c0621f8c37c23 Move declarations to the top of the function. diff -r 116dbb38eac0 -r f2a11c8695a4 libao2/ao_dsound.c --- a/libao2/ao_dsound.c Sun Dec 02 21:40:37 2012 +0000 +++ b/libao2/ao_dsound.c Sun Dec 02 21:44:49 2012 +0000 @@ -416,13 +416,13 @@ static int init(int rate, int channels, int format, int flags) { int res; - if (!InitDirectSound()) return 0; - // ok, now create the buffers WAVEFORMATEXTENSIBLE wformat; DSBUFFERDESC dsbpridesc; DSBUFFERDESC dsbdesc; + if (!InitDirectSound()) return 0; + //check if the channel count and format is supported in general if (channels > 6) { UninitDirectSound();