Index: rtp.c =================================================================== RCS file: /usr/cvsroot/asterisk/rtp.c,v retrieving revision 1.80 diff -u -r1.80 rtp.c --- rtp.c 17 Jul 2004 21:08:12 -0000 1.80 +++ rtp.c 19 Jul 2004 19:03:24 -0000 @@ -1165,10 +1165,9 @@ ast_log(LOG_WARNING, "Unable to create smoother :(\n"); return -1; } - ast_smoother_feed(rtp->smoother, _f); - - while((f = ast_smoother_read(rtp->smoother))) - ast_rtp_raw_write(rtp, f, codec); + if (!ast_smoother_feed(rtp->smoother, _f)) + while((f = ast_smoother_read(rtp->smoother))) + ast_rtp_raw_write(rtp, f, codec); break; case AST_FORMAT_ADPCM: case AST_FORMAT_G726: @@ -1179,10 +1178,9 @@ ast_log(LOG_WARNING, "Unable to create smoother :(\n"); return -1; } - ast_smoother_feed(rtp->smoother, _f); - - while((f = ast_smoother_read(rtp->smoother))) - ast_rtp_raw_write(rtp, f, codec); + if (!ast_smoother_feed(rtp->smoother, _f)) + while((f = ast_smoother_read(rtp->smoother))) + ast_rtp_raw_write(rtp, f, codec); break; case AST_FORMAT_G729A: if (!rtp->smoother) { @@ -1194,10 +1192,9 @@ ast_log(LOG_WARNING, "Unable to create g729 smoother :(\n"); return -1; } - ast_smoother_feed(rtp->smoother, _f); - - while((f = ast_smoother_read(rtp->smoother))) - ast_rtp_raw_write(rtp, f, codec); + if (!ast_smoother_feed(rtp->smoother, _f)) + while((f = ast_smoother_read(rtp->smoother))) + ast_rtp_raw_write(rtp, f, codec); break; case AST_FORMAT_GSM: if (!rtp->smoother) { @@ -1207,9 +1204,9 @@ ast_log(LOG_WARNING, "Unable to create GSM smoother :(\n"); return -1; } - ast_smoother_feed(rtp->smoother, _f); - while((f = ast_smoother_read(rtp->smoother))) - ast_rtp_raw_write(rtp, f, codec); + if (!ast_smoother_feed(rtp->smoother, _f)) + while((f = ast_smoother_read(rtp->smoother))) + ast_rtp_raw_write(rtp, f, codec); break; case AST_FORMAT_ILBC: if (!rtp->smoother) { @@ -1219,9 +1216,9 @@ ast_log(LOG_WARNING, "Unable to create ILBC smoother :(\n"); return -1; } - ast_smoother_feed(rtp->smoother, _f); - while((f = ast_smoother_read(rtp->smoother))) - ast_rtp_raw_write(rtp, f, codec); + if (!ast_smoother_feed(rtp->smoother, _f)) + while((f = ast_smoother_read(rtp->smoother))) + ast_rtp_raw_write(rtp, f, codec); break; default: ast_log(LOG_WARNING, "Not sure about sending format %s packets\n", ast_getformatname(subclass));