Update of /cvsroot/alsa/alsa-kernel/core
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4570/core

Modified Files:
        pcm_native.c 
Log Message:
Added SYNC_PTR ioctl for the PCM interface.


Index: pcm_native.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/pcm_native.c,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -r1.88 -r1.89
--- pcm_native.c        15 Apr 2004 09:16:13 -0000      1.88
+++ pcm_native.c        17 May 2004 06:47:18 -0000      1.89
@@ -2335,6 +2335,37 @@
        return err;
 }
                
+static int snd_pcm_sync_ptr(snd_pcm_substream_t *substream, struct sndrv_pcm_sync_ptr 
*_sync_ptr)
+{
+       snd_pcm_runtime_t *runtime = substream->runtime;
+       struct sndrv_pcm_sync_ptr sync_ptr;
+       volatile struct sndrv_pcm_mmap_status *status;
+       volatile struct sndrv_pcm_mmap_control *control;
+
+       memset(&sync_ptr, 0, sizeof(sync_ptr));
+       if (get_user(sync_ptr.flags, (unsigned int *) &(_sync_ptr->flags)))
+               return -EFAULT;
+       if (copy_from_user(&sync_ptr.c.control, &(_sync_ptr->c.control), sizeof(struct 
sndrv_pcm_mmap_control)))
+               return -EFAULT; 
+       status = runtime->status;
+       control = runtime->control;
+       snd_pcm_stream_lock_irq(substream);
+       control->appl_ptr = sync_ptr.c.control.appl_ptr;
+       control->avail_min = sync_ptr.c.control.avail_min;
+       sync_ptr.s.status.state = status->state;
+       sync_ptr.s.status.hw_ptr = status->hw_ptr;
+       sync_ptr.s.status.tstamp = status->tstamp;
+       sync_ptr.s.status.suspended_state = status->suspended_state;
+       snd_pcm_stream_unlock_irq(substream);
+       if (copy_to_user(_sync_ptr, &sync_ptr, sizeof(sync_ptr))) {
+               return -EFAULT;
+       } else {
+               if (sync_ptr.flags & SNDRV_PCM_SYNC_PTR_HWSYNC)
+                       return snd_pcm_hwsync(substream);
+       }
+       return 0;
+}
+               
 static int snd_pcm_playback_ioctl1(snd_pcm_substream_t *substream,
                                   unsigned int cmd, void *arg);
 static int snd_pcm_capture_ioctl1(snd_pcm_substream_t *substream,
@@ -2388,6 +2419,8 @@
                return snd_pcm_hwsync(substream);
        case SNDRV_PCM_IOCTL_DELAY:
                return snd_pcm_delay(substream, (snd_pcm_sframes_t *) arg);
+       case SNDRV_PCM_IOCTL_SYNC_PTR:
+               return snd_pcm_sync_ptr(substream, (struct sndrv_pcm_sync_ptr *) arg);
        case SNDRV_PCM_IOCTL_HW_REFINE_OLD:
                return snd_pcm_hw_refine_old_user(substream, (struct 
sndrv_pcm_hw_params_old *) arg);
        case SNDRV_PCM_IOCTL_HW_PARAMS_OLD:



-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to