summaryrefslogtreecommitdiffstats
path: root/src/audio/audio_encoder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio/audio_encoder.cpp')
-rw-r--r--src/audio/audio_encoder.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/audio/audio_encoder.cpp b/src/audio/audio_encoder.cpp
index d6ff356..952b1ee 100644
--- a/src/audio/audio_encoder.cpp
+++ b/src/audio/audio_encoder.cpp
@@ -433,7 +433,11 @@ uint16 t_g726_audio_encoder::encode(int16 *sample_buf, uint16 nsamples,
t_g729a_audio_encoder::t_g729a_audio_encoder(uint16 payload_id, uint16 ptime, t_user *user_config)
: t_audio_encoder(payload_id, ptime, user_config)
{
+#ifdef HAVE_BCG729_ANNEX_B
+ _context = initBcg729EncoderChannel(false);
+#else
_context = initBcg729EncoderChannel();
+#endif
}
t_g729a_audio_encoder::~t_g729a_audio_encoder()
@@ -451,7 +455,13 @@ uint16 t_g729a_audio_encoder::encode(int16 *sample_buf, uint16 nsamples,
for (uint16 done = 0; done < nsamples; done += 80)
{
+#ifdef HAVE_BCG729_ANNEX_B
+ uint8 frame_size = 10;
+ bcg729Encoder(_context, &sample_buf[done], &payload[done / 8], &frame_size);
+ assert(frame_size == 10);
+#else
bcg729Encoder(_context, &sample_buf[done], &payload[done / 8]);
+#endif
}
return nsamples / 8;