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

Modified Files:
        pcm_oss.c 
Log Message:
Fixed oss.period_frames setup

Index: pcm_oss.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/oss/pcm_oss.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -r1.64 -r1.65
--- pcm_oss.c   17 Feb 2004 14:51:09 -0000      1.64
+++ pcm_oss.c   17 Feb 2004 18:31:28 -0000      1.65
@@ -133,6 +133,15 @@
        return (runtime->oss.buffer_bytes * frames) / buffer_size;
 }
 
+static long snd_pcm_alsa_frames(snd_pcm_substream_t *substream, long bytes)
+{
+       snd_pcm_runtime_t *runtime = substream->runtime;
+       snd_pcm_uframes_t buffer_size = snd_pcm_lib_buffer_bytes(substream);
+       if (buffer_size == runtime->oss.buffer_bytes)
+               return bytes_to_frames(runtime, bytes);
+       return bytes_to_frames(runtime, (buffer_size * bytes) / 
runtime->oss.buffer_bytes);
+}
+
 static int snd_pcm_oss_format_from(int format)
 {
        switch (format) {
@@ -254,7 +263,7 @@
 
        snd_assert(oss_period_size >= 16, return -EINVAL);
        runtime->oss.period_bytes = oss_period_size;
-       runtime->oss.period_frames = oss_period_size / oss_frame_size;
+       runtime->oss.period_frames = snd_pcm_alsa_frames(substream, oss_period_size);
        runtime->oss.periods = oss_periods;
        return 0;
 }



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to