Author: sayer
Date: 2009-03-10 18:21:34 +0100 (Tue, 10 Mar 2009)
New Revision: 1302

Modified:
   branches/1.1/core/AmPlayoutBuffer.cpp
Log:
do not try to scale too short packets. 

thanks for extensive reporting by juha heinanen



Modified: branches/1.1/core/AmPlayoutBuffer.cpp
===================================================================
--- branches/1.1/core/AmPlayoutBuffer.cpp       2009-03-07 12:13:33 UTC (rev 
1301)
+++ branches/1.1/core/AmPlayoutBuffer.cpp       2009-03-10 17:21:34 UTC (rev 
1302)
@@ -391,6 +391,10 @@
   // safety
   if (packet_len > MAX_PACKET_SAMPLES)
     return s;
+  
+  // not possible to stretch packets shorter than 10ms 
+  if (packet_len < TEMPLATE_SEG)
+      return s;
 
   if (fabs(factor - 1.0) <= SCALE_FACTOR_START) {
 #ifdef DEBUG_PLAYOUTBUF
@@ -462,6 +466,10 @@
 
     // put merged segment into buffer
     buffer_put( cur_ts, merge_buf, TEMPLATE_SEG);
+    if (p_buf_end - srch - TEMPLATE_SEG < 0) {
+      ERROR("audio after merged segment spills over\n");
+      break;
+    }
     // add after merged segment audio from after srch 
     buffer_put( cur_ts + TEMPLATE_SEG, srch + TEMPLATE_SEG, 
                p_buf_end - srch - TEMPLATE_SEG );

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to