]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] Fix wrong switch_assert expressions in switch_core_session_write_frame()
authorAndrey Volk <andywolk@gmail.com>
Tue, 19 May 2020 15:55:36 +0000 (19:55 +0400)
committerAndrey Volk <andywolk@gmail.com>
Tue, 16 Mar 2021 17:33:18 +0000 (20:33 +0300)
src/switch_core_media.c

index d69e1286f51fac0ce2d69f89a68e3597ddf2b477..810306a91dbd339685dc10801fcd3dccd4cbfc9b 100644 (file)
@@ -16018,7 +16018,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
                        session->write_codec->cur_frame = frame;
                        frame->codec->cur_frame = frame;
                        switch_assert(enc_frame->datalen <= SWITCH_RECOMMENDED_BUFFER_SIZE);
-                       switch_assert(session->enc_read_frame.datalen <= SWITCH_RECOMMENDED_BUFFER_SIZE);
+                       switch_assert(session->enc_write_frame.datalen <= SWITCH_RECOMMENDED_BUFFER_SIZE);
                        status = switch_core_codec_encode(session->write_codec,
                                                                                          frame->codec,
                                                                                          enc_frame->data,
@@ -16026,7 +16026,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
                                                                                          session->write_impl.actual_samples_per_second,
                                                                                          session->enc_write_frame.data, &session->enc_write_frame.datalen, &session->enc_write_frame.rate, &flag);
 
-                       switch_assert(session->enc_read_frame.datalen <= SWITCH_RECOMMENDED_BUFFER_SIZE);
+                       switch_assert(session->enc_write_frame.datalen <= SWITCH_RECOMMENDED_BUFFER_SIZE);
 
                        session->write_codec->cur_frame = NULL;
                        frame->codec->cur_frame = NULL;
@@ -16128,7 +16128,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
                                session->write_codec->cur_frame = frame;
                                frame->codec->cur_frame = frame;
                                switch_assert(enc_frame->datalen <= SWITCH_RECOMMENDED_BUFFER_SIZE);
-                               switch_assert(session->enc_read_frame.datalen <= SWITCH_RECOMMENDED_BUFFER_SIZE);
+                               switch_assert(session->enc_write_frame.datalen <= SWITCH_RECOMMENDED_BUFFER_SIZE);
                                status = switch_core_codec_encode(session->write_codec,
                                                                                                  frame->codec,
                                                                                                  enc_frame->data,
@@ -16136,7 +16136,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
                                                                                                  rate,
                                                                                                  session->enc_write_frame.data, &session->enc_write_frame.datalen, &session->enc_write_frame.rate, &flag);
 
-                               switch_assert(session->enc_read_frame.datalen <= SWITCH_RECOMMENDED_BUFFER_SIZE);
+                               switch_assert(session->enc_write_frame.datalen <= SWITCH_RECOMMENDED_BUFFER_SIZE);
 
                                session->write_codec->cur_frame = NULL;
                                frame->codec->cur_frame = NULL;