Take two:
Fix MDRIVER initialisation, add help text. Sndio_PlayStop must call
sio_stop(), otherwise mikmod playback stops after one tune.

Tested with mikmod using sndio/wav drivers on amd64/sparc64. I did not
check port depends.

With the fix below, ok tobiasu@

Index: files/drv_sndio.c
===================================================================
RCS file: /home/vcs/cvs/openbsd/ports/audio/libmikmod/files/drv_sndio.c,v
retrieving revision 1.1
diff -u -p -r1.1 drv_sndio.c
--- files/drv_sndio.c   11 Jan 2010 04:25:26 -0000      1.1
+++ files/drv_sndio.c   10 Jan 2013 04:51:03 -0000
@@ -65,7 +65,7 @@ static BOOL Sndio_Init(void)
                return 1;
        }
 
-       if (!(audiobuffer = (SBYTE *)_mm_malloc(fragsize)))
+       if (!(audiobuffer = (SBYTE *)MikMod_malloc(fragsize)))
                return 1;
 
        sio_initpar(&par);
@@ -106,7 +106,7 @@ static BOOL Sndio_Init(void)
 static void Sndio_Exit(void)
 {
        VC_Exit();
-       _mm_free(audiobuffer);
+       MikMod_free(audiobuffer);
        if (hdl) {
                sio_close(hdl);
                hdl = NULL;
@@ -139,9 +139,8 @@ static BOOL Sndio_PlayStart(void)
 
 static void Sndio_PlayStop(void)
 {
-       //sio_stop(hdl);
-
        VC_PlayStop();
+       sio_stop(hdl);
 }
 
 MIKMODAPI MDRIVER drv_sndio = {
@@ -150,7 +149,7 @@ MIKMODAPI MDRIVER drv_sndio = {
        "sndio audio driver v1.0",
        0, 255,
        "audio",
-
+    "buffer:r:7,17,12:Audio buffer log2 size\n",
        Sndio_CommandLine,
        Sndio_IsThere,
        VC_SampleLoad,

Reply via email to