Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some question about code in speex_jitter_buffer.c #12

Open
chapayGhub opened this issue May 21, 2020 · 2 comments
Open

Some question about code in speex_jitter_buffer.c #12

chapayGhub opened this issue May 21, 2020 · 2 comments

Comments

@chapayGhub
Copy link

chapayGhub commented May 21, 2020

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!

@marauder2k7
Copy link

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

@tmatth
Copy link
Member

tmatth commented Jun 15, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants