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

Modified Files:
        pcm.c 
Log Message:
don't return negative byte count from GET[IO]PTR ioctl

Index: pcm.c
===================================================================
RCS file: /cvsroot/alsa/alsa-oss/alsa/pcm.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- pcm.c       26 Mar 2004 16:13:55 -0000      1.15
+++ pcm.c       4 May 2004 13:02:03 -0000       1.16
@@ -1149,8 +1149,8 @@
                        diff += str->alsa.boundary;
                str->oss.hw_bytes += diff;
                str->oss.hw_bytes %= str->oss.boundary;
-               info->bytes = str->oss.hw_bytes * str->frame_bytes;
-               info->ptr = info->bytes % (str->oss.buffer_size * str->frame_bytes);
+               info->bytes = (str->oss.hw_bytes * str->frame_bytes) & 0x7fffffff;
+               info->ptr = (str->oss.hw_bytes % str->oss.buffer_size) * 
str->frame_bytes;
                if (str->mmap_buffer) {
                        ssize_t n = (hw_ptr / str->oss.period_size) - 
(str->alsa.old_hw_ptr / str->oss.period_size);
                        if (n < 0)
@@ -1192,8 +1192,8 @@
                        diff += str->alsa.boundary;
                str->oss.hw_bytes += diff;
                str->oss.hw_bytes %= str->oss.boundary;
-               info->bytes = str->oss.hw_bytes * str->frame_bytes;
-               info->ptr = info->bytes % (str->oss.buffer_size * str->frame_bytes);
+               info->bytes = (str->oss.hw_bytes * str->frame_bytes) & 0x7fffffff;
+               info->ptr = (str->oss.hw_bytes % str->oss.buffer_size) * 
str->frame_bytes;
                if (str->mmap_buffer) {
                        ssize_t n = (hw_ptr / str->oss.period_size) - 
(str->alsa.old_hw_ptr / str->oss.period_size);
                        if (n < 0)



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to