[Pkg-voip-commits] r2779 - in yate/trunk/debian: . patches

Mikael Magnusson mikma-guest at alioth.debian.org
Sat Dec 2 19:39:05 CET 2006


Author: mikma-guest
Date: 2006-12-02 19:39:04 +0100 (Sat, 02 Dec 2006)
New Revision: 2779

Modified:
   yate/trunk/debian/changelog
   yate/trunk/debian/patches/osschan.dpatch
Log:
* osschan: forward complete 30ms frames only, fixes problem with garbled
  audio.

Modified: yate/trunk/debian/changelog
===================================================================
--- yate/trunk/debian/changelog	2006-12-02 14:46:12 UTC (rev 2778)
+++ yate/trunk/debian/changelog	2006-12-02 18:39:04 UTC (rev 2779)
@@ -7,13 +7,14 @@
   * yate: Add tonedetect module
   * Fix broken MD5 on Big Endian architectures. (Closes: #391454)
   * Bump Standards-Version to 3.7.2. No changes required.
-  * osschan: change to 20ms frames, fixes problem with garbled audio.
+  * osschan: forward complete 30ms frames only, fixes problem with garbled
+    audio.
 
   [ Kilian Krause ]
   * Switch from postgresql-dev to libpq-dev for Build-Depends to pull only
     required amount of packages.
 
- -- Mikael Magnusson <mikma at users.sourceforge.net>  Sat,  2 Dec 2006 14:25:01 +0100
+ -- Mikael Magnusson <mikma at users.sourceforge.net>  Sat,  2 Dec 2006 19:33:28 +0100
 
 yate (1.0.0-1.dfsg-2) unstable; urgency=low
 

Modified: yate/trunk/debian/patches/osschan.dpatch
===================================================================
--- yate/trunk/debian/patches/osschan.dpatch	2006-12-02 14:46:12 UTC (rev 2778)
+++ yate/trunk/debian/patches/osschan.dpatch	2006-12-02 18:39:04 UTC (rev 2779)
@@ -2,19 +2,56 @@
 ## osschan.dpatch by  <mikma at users.sourceforge.net>
 ##
 ## All lines beginning with `## DP:' are a description of the patch.
-## DP: Change to 20ms frame size. Fixes problem with garbled audio in
+## DP: Forward complete 30ms frames only. Fixes problem with garbled audio in
 ## DP: the beginning of calls, and audio delay.
 
 @DPATCH@
-diff -urNad yate-1.1.0-1.dfsg~/modules/osschan.cpp yate-1.1.0-1.dfsg/modules/osschan.cpp
---- yate-1.1.0-1.dfsg~/modules/osschan.cpp	2006-06-10 19:34:54.000000000 +0200
-+++ yate-1.1.0-1.dfsg/modules/osschan.cpp	2006-12-02 14:01:48.000000000 +0100
-@@ -198,7 +198,7 @@
+diff -rN -u old-working/modules/osschan.cpp new-working/modules/osschan.cpp
+--- old-working/modules/osschan.cpp	2006-12-02 19:27:58.000000000 +0100
++++ new-working/modules/osschan.cpp	2006-12-02 19:27:58.000000000 +0100
+@@ -192,14 +192,16 @@
+ {
+     int r = 0;
+     u_int64_t tpos = Time::now();
++    DataBlock data(0,480);
++    int len = 0;
+     do {
+ 	if (m_device->closed()) {
+ 	    Thread::yield();
  	    r = 1;
  	    continue;
  	}
 -	DataBlock data(0,480);
-+	DataBlock data(0,320);
- 	r = ::read(m_device->fd(), data.data(), data.length());
+-	r = ::read(m_device->fd(), data.data(), data.length());
++	unsigned char *ptr = (unsigned char*)data.data() + len;
++	r = ::read(m_device->fd(), ptr, data.length() - len);
  	if (r < 0) {
  	    if (errno == EINTR || errno == EAGAIN) {
+ 		Thread::yield();
+@@ -213,16 +215,21 @@
+ 	    r = 1;
+ 	    continue;
+ 	}
+-	if (r < (int)data.length())
+-	    data.assign(data.data(),r);
++	len += r;
++	if (len < (int)data.length()) {
++	    Thread::yield();
++	    continue;
++	}
++	    
+ 	int64_t dly = tpos - Time::now();
+ 	if (dly > 0) {
+ 	    XDebug("OssSource",DebugAll,"Sleeping for " FMT64 " usec",dly);
+ 	    Thread::usleep((unsigned long)dly);
+ 	}
+ 	Forward(data);
+-	m_total += r;
+-	tpos += (r*1000000ULL/m_brate);
++	m_total += len;
++	tpos += (len*1000000ULL/m_brate);
++	len = 0;
+     } while (r > 0);
+     Debug(DebugAll,"OssSource [%p] end of data",this);
+ }
+




More information about the Pkg-voip-commits mailing list