mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-17 08:44:13 +00:00
FS-7501: add auto sync of jb and fps detection
This commit is contained in:
1 parent
c8a189a433
commit
3e24ac5e6b
8 files changed
+166
-18
No files matched your search
@@ -2263,7 +2263,7 @@ static void verto_set_media_options(verto_pvt_t *tech_pvt, verto_profile_t *prof
|
||||
tech_pvt->mparams->inbound_codec_string = switch_core_session_strdup(tech_pvt->session, profile->inbound_codec_string);
|
||||
tech_pvt->mparams->outbound_codec_string = switch_core_session_strdup(tech_pvt->session, profile->outbound_codec_string);
|
||||
|
||||
tech_pvt->mparams->jb_msec = "-1";
|
||||
//tech_pvt->mparams->jb_msec = "-1";
|
||||
switch_media_handle_set_media_flag(tech_pvt->smh, SCMF_SUPPRESS_CNG);
|
||||
|
||||
switch_media_handle_set_media_flag(tech_pvt->smh, SCMF_RENEG_ON_REINVITE);
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <libavutil/channel_layout.h>
|
||||
// #include <libavutil/timestamp.h>
|
||||
#include <libavresample/avresample.h>
|
||||
#define DFT_RECORD_OFFSET 350
|
||||
|
||||
SWITCH_MODULE_LOAD_FUNCTION(mod_avformat_load);
|
||||
SWITCH_MODULE_DEFINITION(mod_avformat, mod_avformat_load, NULL, NULL);
|
||||
@@ -665,7 +666,7 @@ SWITCH_STANDARD_APP(record_av_function)
|
||||
char buf[SWITCH_RECOMMENDED_BUFFER_SIZE] = {0};
|
||||
switch_size_t datalen = codec.implementation->decoded_bytes_per_packet;
|
||||
switch_size_t samples = datalen / 2 / codec.implementation->number_of_channels;
|
||||
int offset = 1200;
|
||||
int offset = DFT_RECORD_OFFSET;
|
||||
int fps = codec.implementation->actual_samples_per_second / samples;
|
||||
int lead_frames = (offset * fps) / 1000;
|
||||
|
||||
@@ -1139,7 +1140,7 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa
|
||||
|
||||
memset(context, 0, sizeof(av_file_context_t));
|
||||
|
||||
context->offset = 1200;
|
||||
context->offset = DFT_RECORD_OFFSET;
|
||||
if (handle->params && (tmp = switch_event_get_header(handle->params, "av_video_offset"))) {
|
||||
context->offset = atoi(tmp);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user