summaryrefslogtreecommitdiffstats
path: root/src/audio
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio')
-rw-r--r--src/audio/audio_decoder.cpp8
-rw-r--r--src/audio/audio_encoder.cpp10
2 files changed, 18 insertions, 0 deletions
diff --git a/src/audio/audio_decoder.cpp b/src/audio/audio_decoder.cpp
index 65935dd..c661910 100644
--- a/src/audio/audio_decoder.cpp
+++ b/src/audio/audio_decoder.cpp
@@ -547,7 +547,11 @@ uint16 t_g729a_audio_decoder::decode(uint8 *payload, uint16 payload_size,
for (uint16 done = 0; done < payload_size; done += 10)
{
+#ifdef HAVE_BCG729_ANNEX_B
+ bcg729Decoder(_context, &payload[done], 0, false, false, false, &pcm_buf[done * 8]);
+#else
bcg729Decoder(_context, &payload[done], false, &pcm_buf[done * 8]);
+#endif
}
return payload_size * 8;
@@ -562,7 +566,11 @@ uint16 t_g729a_audio_decoder::conceal(int16 *pcm_buf, uint16 pcm_buf_size)
{
assert(pcm_buf_size >= 80);
+#ifdef HAVE_BCG729_ANNEX_B
+ bcg729Decoder(_context, nullptr, 0, true, false, false, pcm_buf);
+#else
bcg729Decoder(_context, nullptr, true, pcm_buf);
+#endif
return 80;
}
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;