[alsa-cvslog] CVS: alsa-lib/src/pcm pcm_rate.c,1.73,1.74

2003-09-10 Thread Takashi Iwai
Update of /cvsroot/alsa/alsa-lib/src/pcm
In directory sc8-pr-cvs1:/tmp/cvs-serv514

Modified Files:
pcm_rate.c 
Log Message:
corrections in the last changes.
samples are exapnded properly in linear interpolation now.



Index: pcm_rate.c
===
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm_rate.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- pcm_rate.c  9 Sep 2003 19:04:22 -   1.73
+++ pcm_rate.c  10 Sep 2003 11:02:57 -  1.74
@@ -126,29 +126,25 @@
dst_step = snd_pcm_channel_area_step(dst_area);
src_frames1 = 0;
dst_frames1 = 0;
-   if (states-init) {
+   if (! states-init) {
sample = initial_sample(src, getidx);
-   src_frames1++;
-   states-init = 0;
old_sample = new_sample = sample;
-   goto put_sample;
+   src += src_step;
+   src_frames1++;
+   states-init = 2; /* get a new sample */
}
-   while (dst_frames1  dst_frames  src_frames1  src_frames) {
-   pos += DIV;
-   if (pos = get_threshold) {
+   while (dst_frames1  dst_frames) {
+   if (states-init == 2) {
old_sample = new_sample;
-   pos -= get_threshold;
goto *get;
 #define GET16_END after_get
 #include plugin_ops.h
 #undef GET16_END
after_get:
new_sample = sample;
-   src += src_step;
-   src_frames1++;
+   states-init = 1;
}
sample = (((int64_t)old_sample * (int64_t)(get_threshold - 
pos)) + ((int64_t)new_sample * pos)) / get_threshold;
-   put_sample:
goto *put;
 #define PUT16_END after_put
 #include plugin_ops.h
@@ -156,7 +152,16 @@
after_put:
dst += dst_step;
dst_frames1++;
-   }
+   pos += DIV;
+   if (pos = get_threshold) {
+   pos -= get_threshold;
+   src += src_step;
+   src_frames1++;
+   states-init = 2; /* get a new sample */
+   if (src_frames1 = src_frames)
+   break;
+   }
+   } 
states-old_sample = old_sample;
states-new_sample = new_sample;
states-pos = pos;



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog


[alsa-cvslog] CVS: alsa-kernel/include pcm_oss.h,1.6,1.7

2003-09-10 Thread Jaroslav Kysela
Update of /cvsroot/alsa/alsa-kernel/include
In directory sc8-pr-cvs1:/tmp/cvs-serv31131/include

Modified Files:
pcm_oss.h 
Log Message:
Fixed comments in pcm_oss.h
Fixed sync() routine for the partial playback transfers


Index: pcm_oss.h
===
RCS file: /cvsroot/alsa/alsa-kernel/include/pcm_oss.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- pcm_oss.h   24 Jul 2003 20:50:21 -  1.6
+++ pcm_oss.h   10 Sep 2003 13:51:30 -  1.7
@@ -51,11 +51,11 @@
unsigned int subdivision;   /* requested subdivision */
size_t period_bytes;/* requested period size */
unsigned int periods;
-   size_t buffer_bytes;/* requested period size */
+   size_t buffer_bytes;/* requested buffer size */
size_t bytes;   /* total # bytes processed */
size_t mmap_bytes;
char *buffer;   /* vmallocated period */
-   size_t buffer_used; /* used length from buffer */
+   size_t buffer_used; /* used length from period buffer */
snd_pcm_plugin_t *plugin_first;
snd_pcm_plugin_t *plugin_last;
unsigned int prev_hw_ptr_interrupt;



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog