From 4c1a2e092295ddb001a98dd779af091ba2aa3526 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 30 Aug 2006 22:03:52 +0000 Subject: [PATCH] fix some bugs and g726 wip (only 32 works so far) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2459 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/codecs/mod_g726/mod_g726.c | 7 ++++--- src/mod/endpoints/mod_dingaling/mod_dingaling.c | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mod/codecs/mod_g726/mod_g726.c b/src/mod/codecs/mod_g726/mod_g726.c index 4ee4c1d9b7..861df5838c 100644 --- a/src/mod/codecs/mod_g726/mod_g726.c +++ b/src/mod/codecs/mod_g726/mod_g726.c @@ -159,7 +159,7 @@ static switch_status_t switch_g726_encode(switch_codec_t *codec, //printf("new byte assign the %d bits\n", handle->bits_per_frame); *handle->ptr = edata; } else if (bits <= BITS_IN_A_BYTE) { - int shift_by = ((handle->bits_per_frame * (handle->ecount)) - handle->bits_per_frame); + int shift_by = ((handle->bits_per_frame * (handle->ecount -1))); //printf ("shift by %d and add %d bits\n", shift_by, handle->bits_per_frame); //*handle->ptr <<= shift_by; //*handle->ptr |= edata; @@ -168,8 +168,9 @@ static switch_status_t switch_g726_encode(switch_codec_t *codec, //printf("edata\n"); //print_bits(edata); //printf("\n"); - - *handle->ptr |= (edata << 4); + + *handle->ptr <<= shift_by; + *handle->ptr |= edata; //printf("handle\n"); //print_bits(*handle->ptr); diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index e551d6f9b3..4e7fb9a233 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -458,7 +458,10 @@ static char *lame(char *in) static int do_describe(struct private_object *tech_pvt, int force) { ldl_payload_t payloads[5]; - assert(switch_core_session_get_channel(tech_pvt->session) != NULL); + + if (!tech_pvt->session) { + return 0; + } if (switch_test_flag(tech_pvt, TFLAG_DO_DESC)) { return 1;