Author: sayer
Date: 2009-03-10 18:23:03 +0100 (Tue, 10 Mar 2009)
New Revision: 1303
Modified:
trunk/core/AmPlayoutBuffer.cpp
Log:
do not try to scale too short packets.
thanks for extensive reporting by juha heinanen
Modified: trunk/core/AmPlayoutBuffer.cpp
===================================================================
--- trunk/core/AmPlayoutBuffer.cpp 2009-03-10 17:21:34 UTC (rev 1302)
+++ trunk/core/AmPlayoutBuffer.cpp 2009-03-10 17:23:03 UTC (rev 1303)
@@ -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