speex icon indicating copy to clipboard operation
speex copied to clipboard

Some question about code in speex_jitter_buffer.c

Open chapayGhub opened this issue 5 years ago • 2 comments

I can not understand why we make speex_decode_int of jitter->current_packet 2 times first time after get packet from buffer, after set flag valid_bits to 1, second time at next speex_jitter_get call

speex_jitter_buffer.c:

void speex_jitter_get(SpeexJitter *jitter, spx_int16_t *out, int *current_timestamp) {
   //....
   if (jitter->valid_bits)
   {
//
//         here we decode last received packet to out second time
//
      ret = speex_decode_int(jitter->dec, &jitter->current_packet, out);
      //...
   }
   
   //....

//     
//        here we decode last received packet to out first time
//
      ret = speex_decode_int(jitter->dec, &jitter->current_packet, out);
      if (ret == 0)
      {
         jitter->valid_bits = 1;
     }
//....
}

Thanks!

chapayGhub avatar May 21 '20 09:05 chapayGhub

Do you have to download an older version of speex to use jitterbuffer? The header file speex_jitter.h is no longer in the latest branch

marauder2k7 avatar Jun 15 '21 11:06 marauder2k7

Do you have to download an older version of speex to use jitterbuffer? The header file speex_jitter.h is no longer in the latest branch

The speex the codec and speexdsp the DSP library have been split into separate projects, see https://gitlab.xiph.org/xiph/speexdsp/-/blob/master/include/speex/speex_jitter.h

tmatth avatar Jun 15 '21 13:06 tmatth