Merged revisions 293970 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r293970 | sruffell | 2010-11-04 19:07:11 -0500 (Thu, 04 Nov 2010) | 32 lines
  
  Merged revisions 293969 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r293969 | sruffell | 2010-11-04 19:06:02 -0500 (Thu, 04 Nov 2010) | 25 lines
    
    Merged revisions 293968 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r293968 | sruffell | 2010-11-04 19:02:53 -0500 (Thu, 04 Nov 2010) | 17 lines
      
      codecs/codec_dahdi: Prevent "choppy" audio when receiving unexpected frame sizes.
      
      dahdi-linux 2.4.0 (specifically commit 9034) added the capability for
      the wctc4xxp to return more than a single packet of data in response to
      a read.  However, when decoding packets, codec_dahdi was still assuming
      that the default number of samples was in each read.
      
      In other words, each packet your provider sent you, regardless of size,
      would result in 20 ms of decoded data (30 ms if decoding G723). If your
      provider was sending 60 ms packets then codec_dahdi would end up
      stripping 40 ms of data from each transcoded frame resulting in "choppy"
      audio.
      
      This would only affect systems where G729 packets are arriving in sizes
      greater than 20ms or G723 packets arriving in sizes greater than 30ms.
      
      DAHDI-744.
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@293971 65c4cc65-6c06-0410-ace0-fbb531ad65f3
remotes/origin/10-digiumphones
Shaun Ruffell 14 years ago
parent dcd6dae413
commit 178f3f1848

@ -92,10 +92,10 @@ struct codec_dahdi_pvt {
}; };
/* Only used by a decoder */ /* Only used by a decoder */
static int ulawtolin(struct ast_trans_pvt *pvt) static int ulawtolin(struct ast_trans_pvt *pvt, int samples)
{ {
struct codec_dahdi_pvt *dahdip = pvt->pvt; struct codec_dahdi_pvt *dahdip = pvt->pvt;
int i = dahdip->required_samples; int i = samples;
uint8_t *src = &dahdip->ulaw_buffer[0]; uint8_t *src = &dahdip->ulaw_buffer[0];
int16_t *dst = pvt->outbuf.i16 + pvt->datalen; int16_t *dst = pvt->outbuf.i16 + pvt->datalen;
@ -331,7 +331,7 @@ static struct ast_frame *dahdi_decoder_frameout(struct ast_trans_pvt *pvt)
} }
} else { } else {
if (dahdip->softslin) { if (dahdip->softslin) {
ulawtolin(pvt); ulawtolin(pvt, res);
pvt->f.datalen = res * 2; pvt->f.datalen = res * 2;
} else { } else {
pvt->f.datalen = res; pvt->f.datalen = res;
@ -343,7 +343,7 @@ static struct ast_frame *dahdi_decoder_frameout(struct ast_trans_pvt *pvt)
pvt->f.offset = AST_FRIENDLY_OFFSET; pvt->f.offset = AST_FRIENDLY_OFFSET;
pvt->f.src = pvt->t->name; pvt->f.src = pvt->t->name;
pvt->f.data.ptr = pvt->outbuf.c; pvt->f.data.ptr = pvt->outbuf.c;
pvt->f.samples = dahdip->required_samples; pvt->f.samples = res;
pvt->samples = 0; pvt->samples = 0;
return ast_frisolate(&pvt->f); return ast_frisolate(&pvt->f);

Loading…
Cancel
Save