]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
copy part of 0e7eb72ca75a3584d203c6464fc8ceaacf79ebae
authorAnthony Minessale <anthm@freeswitch.org>
Sat, 25 Apr 2015 18:22:43 +0000 (13:22 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Sat, 25 Apr 2015 18:22:43 +0000 (13:22 -0500)
src/include/switch_core.h
src/switch_core_codec.c
src/switch_core_io.c

index e783dbd76785b4f8b1c7b1fb2682426a74bca0cc..6e384502ffcc8ea1c1c6927eafd5f85a5feba1a4 100644 (file)
@@ -1574,7 +1574,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_init_with_bitrate(switch_codec
                                                                                                           uint32_t bitrate,
                                                                                                           uint32_t flags, const switch_codec_settings_t *codec_settings, switch_memory_pool_t *pool);
 
-SWITCH_DECLARE(switch_status_t) switch_core_codec_copy(switch_codec_t *codec, switch_codec_t *new_codec, switch_memory_pool_t *pool);
+SWITCH_DECLARE(switch_status_t) switch_core_codec_copy(switch_codec_t *codec, switch_codec_t *new_codec, 
+                                                                                                          const switch_codec_settings_t *codec_settings, switch_memory_pool_t *pool);
 SWITCH_DECLARE(switch_status_t) switch_core_codec_parse_fmtp(const char *codec_name, const char *fmtp, uint32_t rate, switch_codec_fmtp_t *codec_fmtp);
 SWITCH_DECLARE(switch_status_t) switch_core_codec_reset(switch_codec_t *codec);
 
index ef22e7714ffcc76ac7a6fbba58bc4dc5c5b51745..f766704059a2e10ec00c3b67fe9197ea0a6f5c88 100644 (file)
@@ -616,7 +616,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_reset(switch_codec_t *codec)
 }
 
 
-SWITCH_DECLARE(switch_status_t) switch_core_codec_copy(switch_codec_t *codec, switch_codec_t *new_codec, switch_memory_pool_t *pool)
+SWITCH_DECLARE(switch_status_t) switch_core_codec_copy(switch_codec_t *codec, switch_codec_t *new_codec, 
+                                                                                                          const switch_codec_settings_t *codec_settings, switch_memory_pool_t *pool)
 {
        switch_status_t status;
 
@@ -643,8 +644,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_copy(switch_codec_t *codec, sw
                new_codec->fmtp_in = switch_core_strdup(new_codec->memory_pool, codec->fmtp_in);
        }
 
-       new_codec->implementation->init(new_codec, new_codec->flags, NULL);
-
+       new_codec->implementation->init(new_codec, new_codec->flags, codec_settings);
+       
        switch_mutex_init(&new_codec->mutex, SWITCH_MUTEX_NESTED, new_codec->memory_pool);
 
        return SWITCH_STATUS_SUCCESS;
index cb056adb73b406b9ce3d0a06d2628f280896ec40..4c39bbbb425f5db50feca0ad0cd2e8070cc287a2 100644 (file)
@@ -527,7 +527,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
                                        if (!switch_core_codec_ready(&session->bug_codec) && switch_core_codec_ready(read_frame->codec)) {
                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Setting BUG Codec %s:%d\n",
                                                                                  read_frame->codec->implementation->iananame, read_frame->codec->implementation->ianacode);
-                                               switch_core_codec_copy(read_frame->codec, &session->bug_codec, NULL);
+                                               switch_core_codec_copy(read_frame->codec, &session->bug_codec, NULL, NULL);
                                                if (!switch_core_codec_ready(&session->bug_codec)) {
                                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "%s Error setting BUG codec %s!\n", 
                                                                                          switch_core_session_get_name(session), read_frame->codec->implementation->iananame);