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

Mikael Magnusson mikma-guest at alioth.debian.org
Thu Dec 7 22:52:31 CET 2006


Author: mikma-guest
Date: 2006-12-07 22:52:31 +0100 (Thu, 07 Dec 2006)
New Revision: 2793

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

Modified: yate/trunk/debian/changelog
===================================================================
--- yate/trunk/debian/changelog	2006-12-07 21:21:16 UTC (rev 2792)
+++ yate/trunk/debian/changelog	2006-12-07 21:52:31 UTC (rev 2793)
@@ -7,14 +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: forward complete 30ms frames only, fixes problem with garbled
-    audio.
+  * osschan: collect and forward complete 20ms frames, 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 19:33:28 +0100
+ -- Mikael Magnusson <mikma at users.sourceforge.net>  Thu,  7 Dec 2006 22:50:03 +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-07 21:21:16 UTC (rev 2792)
+++ yate/trunk/debian/patches/osschan.dpatch	2006-12-07 21:52:31 UTC (rev 2793)
@@ -2,52 +2,81 @@
 ## osschan.dpatch by  <mikma at users.sourceforge.net>
 ##
 ## All lines beginning with `## DP:' are a description of the patch.
-## DP: Forward complete 30ms frames only. Fixes problem with garbled audio in
-## DP: the beginning of calls, and audio delay.
+## DP: Collect and forward complete 20ms frames.
+## DP: Fixes problem with garbled audio in the beginning of calls.
+## DP: From upstream yate CVS @ 2006-12-07 01:16:41 by paulc
 
 @DPATCH@
-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 @@
+diff -rN -u old-upstream/modules/osschan.cpp new-upstream/modules/osschan.cpp
+--- old-upstream/modules/osschan.cpp	2006-12-07 22:15:37.000000000 +0100
++++ new-upstream/modules/osschan.cpp	2006-12-07 22:15:37.000000000 +0100
+@@ -42,6 +42,9 @@
+ // How long (in usec) before we force I/O direction change
+ #define MIN_SWITCH_TIME 600000
+ 
++// Buffer size in bytes - match the preferred 20ms
++#define OSS_BUFFER_SIZE 320
++
+ using namespace TelEngine;
+ namespace { // anonymous
+ 
+@@ -59,6 +62,7 @@
+     OssDevice* m_device;
+     unsigned m_brate;
+     unsigned m_total;
++    DataBlock m_data;
+ };
+ 
+ class OssConsumer : public DataConsumer
+@@ -175,7 +179,7 @@
+ }
+ 
+ OssSource::OssSource(OssDevice* dev)
+-    : m_device(0)
++    : m_device(0), m_data(0,OSS_BUFFER_SIZE)
  {
+     Debug(DebugAll,"OssSource::OssSource(%p) [%p]",dev,this);
+     dev->ref();
+@@ -191,6 +195,7 @@
+ void OssSource::run()
+ {
      int r = 0;
++    int len = 0;
      u_int64_t tpos = Time::now();
-+    DataBlock data(0,480);
-+    int len = 0;
      do {
  	if (m_device->closed()) {
- 	    Thread::yield();
+@@ -198,8 +203,8 @@
  	    r = 1;
  	    continue;
  	}
 -	DataBlock data(0,480);
 -	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);
++	unsigned char* ptr = (unsigned char*)m_data.data() + len;
++	r = ::read(m_device->fd(), ptr, m_data.length() - len);
  	if (r < 0) {
  	    if (errno == EINTR || errno == EAGAIN) {
  		Thread::yield();
-@@ -213,16 +215,21 @@
+@@ -213,16 +218,21 @@
  	    r = 1;
  	    continue;
  	}
 -	if (r < (int)data.length())
 -	    data.assign(data.data(),r);
 +	len += r;
-+	if (len < (int)data.length()) {
++	if (len < (int)m_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);
+-	Forward(data);
 -	m_total += r;
 -	tpos += (r*1000000ULL/m_brate);
++	Forward(m_data);
 +	m_total += len;
 +	tpos += (len*1000000ULL/m_brate);
 +	len = 0;




More information about the Pkg-voip-commits mailing list