Skip to content
Snippets Groups Projects
Commit cf2b8d50 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

add nbSampleMax for unresampled data (#1143)

parent c7c1b7aa
Branches
Tags
No related merge requests found
......@@ -398,7 +398,7 @@ AudioRtpRTX::sendSessionFromMic(int timestamp)
int nbSamplesMax = _layerFrameSize * _audiocodec->getClockRate() / 1000;
_debug("_nbSamplesMax %i\n", nbSamplesMax);
//_debug("resample data = %i\n", nb_sample_up);
_debug("resample data = %i\n", nb_sample_up);
nbSample = reSampleData(_audiocodec->getClockRate(), nb_sample_up, DOWN_SAMPLING);
if ( nbSample < nbSamplesMax - 10 ) { // if only 10 is missing, it's ok
......@@ -410,6 +410,7 @@ AudioRtpRTX::sendSessionFromMic(int timestamp)
} else {
int nbSamplesMax = 128;
// no resampling required
compSize = _audiocodec->codecEncode( micDataEncoded, micData, nbSample*sizeof(int16));
......
......@@ -26,8 +26,7 @@
class Celt : public AudioCodec{
public:
Celt(int payload=0)
: AudioCodec(payload, "celt"),
_celt_frame_size(128)
: AudioCodec(payload, "celt")
{
_clockRate = 44100;
_frameSize = 512; // fixed frameSize, TODO: support 64 to 512 frame size
......@@ -86,7 +85,8 @@ class Celt : public AudioCodec{
virtual int codecEncode (unsigned char *dst, short *src, unsigned int size)
{
int len = 0;
len = celt_encode(enc, (celt_int16_t *)src, NULL, dst, size);
len = celt_encode(enc, (celt_int16_t *)src, NULL, dst, 128);
// returns the number of bytes writen
return len;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment