]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Some cleaning to mmap
authorAbramo Bagnara <abramo@alsa-project.org>
Mon, 11 Dec 2000 15:54:55 +0000 (15:54 +0000)
committerAbramo Bagnara <abramo@alsa-project.org>
Mon, 11 Dec 2000 15:54:55 +0000 (15:54 +0000)
src/pcm/pcm_mmap.c
src/pcm/pcm_plug.c
src/pcm/pcm_plugin.c

index a713471b25640159f4b6023e50653c791d3ce24e..7e05a09ad1d57b9ceb3109c412fe1f2034d829a9 100644 (file)
@@ -378,11 +378,16 @@ int snd_pcm_munmap(snd_pcm_t *pcm)
                size = PAGE_ALIGN(size);
                switch (i->type) {
                case SND_PCM_AREA_MMAP:
+#if 0
+                       /* Tricky here: for alsa-oss */
+                       errno = 12345;
+#endif
                        err = munmap(i->addr, size);
                        if (err < 0) {
                                SYSERR("mmap failed");
                                return -errno;
                        }
+                       errno = 0;
                        break;
                case SND_PCM_AREA_SHM:
                        err = shmdt(i->addr);
index 3dc7cfacbbcb3d0b0b450f61266b62a8bf7041b8..9c6c14260f1bfe2ff5b56522d89695c06543b1f7 100644 (file)
@@ -620,19 +620,11 @@ static int snd_pcm_plug_channel_info(snd_pcm_t *pcm, snd_pcm_channel_info_t *inf
 
 static int snd_pcm_plug_mmap(snd_pcm_t *pcm ATTRIBUTE_UNUSED)
 {
-#if 0
-       snd_pcm_plugin_t *plug = pcm->private;
-       return snd_pcm_mmap(plug->slave);
-#endif
        return 0;
 }
 
 static int snd_pcm_plug_munmap(snd_pcm_t *pcm ATTRIBUTE_UNUSED)
 {
-#if 0
-       snd_pcm_plugin_t *plug = pcm->private;
-       return snd_pcm_munmap(plug->slave);
-#endif
        return 0;
 }
 
index 253c147fe2df3b141ccd4f4528a9abf021f879ae..d8d36232e0b466f042e63f9a4a521ed1a412d52e 100644 (file)
@@ -321,15 +321,13 @@ int snd_pcm_plugin_set_avail_min(snd_pcm_t *pcm, size_t frames)
 int snd_pcm_plugin_mmap(snd_pcm_t *pcm)
 {
        snd_pcm_plugin_t *plug = pcm->private;
-       if (!(pcm->info & SND_PCM_INFO_MMAP)) {
-               size_t size = snd_pcm_frames_to_bytes(pcm, pcm->buffer_size);
-               int id = shmget(IPC_PRIVATE, size, 0666);
-               if (id < 0) {
-                       SYSERR("shmget failed");
-                       return -errno;
-               }
-               plug->shmid = id;
+       size_t size = snd_pcm_frames_to_bytes(pcm, pcm->buffer_size);
+       int id = shmget(IPC_PRIVATE, size, 0666);
+       if (id < 0) {
+               SYSERR("shmget failed");
+               return -errno;
        }
+       plug->shmid = id;
        return 0;
 }