From: Seven Du Date: Thu, 31 Aug 2017 00:11:11 +0000 (+0800) Subject: FS-10503 #comment disable write buffer for rtsp streaming X-Git-Tag: v1.8.0~286 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=951b6c14642b4a9076435ed517eca379a207e457;p=thirdparty%2Ffreeswitch.git FS-10503 #comment disable write buffer for rtsp streaming --- diff --git a/src/mod/applications/mod_av/avformat.c b/src/mod/applications/mod_av/avformat.c index 9a431ffc82..e493a59371 100644 --- a/src/mod/applications/mod_av/avformat.c +++ b/src/mod/applications/mod_av/avformat.c @@ -1544,6 +1544,7 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa const char *format = NULL; int ret; char file[1024]; + int disable_write_buffer = 0; switch_status_t status = SWITCH_STATUS_SUCCESS; switch_set_string(file, path); @@ -1564,6 +1565,7 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa } else if (handle->stream_name && !strcasecmp(handle->stream_name, "rtsp")) { format = "rtsp"; switch_snprintf(file, sizeof(file), "rtsp://%s", path); + disable_write_buffer = 1; } @@ -1798,6 +1800,10 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa handle->speed = 0; handle->pos = 0; + if (disable_write_buffer) { + handle->pre_buffer_datalen = 0; + } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Opening File [%s] %dhz %s\n", file, handle->samplerate, context->has_video ? " with VIDEO" : "");