[polypaudio-commits] r694 - in /trunk/src/polyp: context.c stream.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Wed Apr 12 16:57:25 PDT 2006


Author: lennart
Date: Thu Apr 13 01:57:25 2006
New Revision: 694

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=694&root=polypaudio&view=rev
Log:
include local record memblockq in latency calculations

Modified:
    trunk/src/polyp/context.c
    trunk/src/polyp/stream.c

Modified: trunk/src/polyp/context.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/context.c?rev=694&root=polypaudio&r1=693&r2=694&view=diff
==============================================================================
--- trunk/src/polyp/context.c (original)
+++ trunk/src/polyp/context.c Thu Apr 13 01:57:25 2006
@@ -294,12 +294,14 @@
     assert(c->ref >= 1);
 
     pa_context_ref(c);
-    
+
     if ((s = pa_dynarray_get(c->record_streams, channel))) {
+
+        assert(seek == PA_SEEK_RELATIVE && offset == 0);
 
         pa_memblockq_seek(s->record_memblockq, offset, seek);
         pa_memblockq_push_align(s->record_memblockq, chunk);
-
+        
         if (s->read_callback) {
             size_t l;
 

Modified: trunk/src/polyp/stream.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/stream.c?rev=694&root=polypaudio&r1=693&r2=694&view=diff
==============================================================================
--- trunk/src/polyp/stream.c (original)
+++ trunk/src/polyp/stream.c Thu Apr 13 01:57:25 2006
@@ -662,6 +662,10 @@
     PA_CHECK_VALIDITY(s->context, s->peek_memchunk.memblock, PA_ERR_BADSTATE);
     
     pa_memblockq_drop(s->record_memblockq, &s->peek_memchunk, s->peek_memchunk.length);
+
+    /* Fix the simulated local read index */
+    if (s->timing_info_valid && !s->timing_info.read_index_corrupt)
+        s->timing_info.read_index += s->peek_memchunk.length;
     
     pa_memblock_unref(s->peek_memchunk.memblock);
     s->peek_memchunk.length = 0;
@@ -814,6 +818,13 @@
             }
         }
 
+        if (o->stream->direction == PA_STREAM_RECORD) {
+            /* Read index correction */
+
+            if (!i->read_index_corrupt)
+                i->read_index -= pa_memblockq_get_length(o->stream->record_memblockq);
+        }
+        
         o->stream->ipol_timestamp = now;
         o->stream->ipol_usec_valid = 0;
     }




More information about the pulseaudio-commits mailing list