]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4700 FS-4701 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 9 Oct 2012 17:28:19 +0000 (12:28 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 9 Oct 2012 17:28:19 +0000 (12:28 -0500)
src/switch_core_media_bug.c

index 370b22a5f73a307051a228865d08e33740ed2c94..19462b98b41be48ac4c0bec2cddac164de1fb74b 100644 (file)
@@ -244,12 +244,18 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b
                        if (switch_core_session_get_partner(bug->session, &other_session) == SWITCH_STATUS_SUCCESS) {
                                switch_core_session_get_read_impl(other_session, &other_read_impl);
                                switch_core_session_rwunlock(other_session);
-                               
-                               if (read_impl.decoded_bytes_per_packet < other_read_impl.decoded_bytes_per_packet) {
-                                       frame_size = other_read_impl.decoded_bytes_per_packet;
+
+                               if (read_impl.actual_samples_per_second == other_read_impl.actual_samples_per_second) {
+                                       if (read_impl.decoded_bytes_per_packet < other_read_impl.decoded_bytes_per_packet) {
+                                               frame_size = other_read_impl.decoded_bytes_per_packet;
+                                       }                                       
+                               } else {
+                                       if (read_impl.decoded_bytes_per_packet > other_read_impl.decoded_bytes_per_packet) {
+                                               frame_size = other_read_impl.decoded_bytes_per_packet;
+                                       }
                                }
                        }
-                       
+
                        bug->record_frame_size = frame_size;
                }
        }