Update of /cvsroot/alsa/alsa-kernel/core
In directory sc8-pr-cvs1:/tmp/cvs-serv21532/core

Modified Files:
        pcm_native.c 
Log Message:
Added open flag to disallow calling hw_free and close callbacks when open was not 
called before

Index: pcm_native.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/pcm_native.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- pcm_native.c        1 Mar 2003 18:56:35 -0000       1.49
+++ pcm_native.c        12 Mar 2003 12:14:03 -0000      1.50
@@ -1746,9 +1746,12 @@
        runtime = substream->runtime;
        str = substream->pstr;
        snd_pcm_unlink(substream);
-       if (substream->ops->hw_free != NULL)
-               substream->ops->hw_free(substream);
-       substream->ops->close(substream);
+       if (substream->open_flag) {
+               if (substream->ops->hw_free != NULL)
+                       substream->ops->hw_free(substream);
+               substream->ops->close(substream);
+               substream->open_flag = 0;
+       }
        substream->ffile = NULL;
        snd_pcm_remove_file(str, pcm_file);
        snd_pcm_release_substream(substream);
@@ -1797,6 +1800,7 @@
                snd_pcm_release_file(pcm_file);
                return err;
        }
+       substream->open_flag = 1;
 
        err = snd_pcm_hw_constraints_complete(substream);
        if (err < 0) {



-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to