]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix some bugs and g726 wip (only 32 works so far)
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 30 Aug 2006 22:03:52 +0000 (22:03 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 30 Aug 2006 22:03:52 +0000 (22:03 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2459 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/codecs/mod_g726/mod_g726.c
src/mod/endpoints/mod_dingaling/mod_dingaling.c

index 4ee4c1d9b79d72dacc3279dc55bf9f4bb6dd688b..861df5838c605d453e415fa555f81634b37264af 100644 (file)
@@ -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);
index e551d6f9b3aee328145a26240f46069a2bd31525..4e7fb9a23357f602346840ddabf73991c4cc84ad 100644 (file)
@@ -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;