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

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

Index: pcm_oss.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/oss/pcm_oss.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- pcm_oss.c   28 Feb 2003 09:22:55 -0000      1.31
+++ pcm_oss.c   12 Mar 2003 12:14:03 -0000      1.32
@@ -1480,9 +1480,12 @@
                if (snd_pcm_running(substream))
                        snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP);
                spin_unlock_irq(&runtime->lock);
-               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_oss_release_substream(substream);
                snd_pcm_release_substream(substream);
@@ -1546,6 +1549,7 @@
                        snd_pcm_oss_release_file(pcm_oss_file);
                        return err;
                }
+               psubstream->open_flag = 1;
                err = snd_pcm_hw_constraints_complete(psubstream);
                if (err < 0) {
                        snd_printd("snd_pcm_hw_constraint_complete failed\n");
@@ -1567,6 +1571,7 @@
                        snd_pcm_oss_release_file(pcm_oss_file);
                        return err;
                }
+               csubstream->open_flag = 1;
                err = snd_pcm_hw_constraints_complete(csubstream);
                if (err < 0) {
                        snd_printd("snd_pcm_hw_constraint_complete failed\n");



-------------------------------------------------------
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