]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10503 #comment disable write buffer for rtsp streaming
authorSeven Du <dujinfang@x-y-t.cn>
Thu, 31 Aug 2017 00:11:11 +0000 (08:11 +0800)
committerSeven Du <dujinfang@x-y-t.cn>
Thu, 31 Aug 2017 00:11:49 +0000 (08:11 +0800)
src/mod/applications/mod_av/avformat.c

index 9a431ffc8255ba90a7d625e52a3914198be8bc3c..e493a593710ad984cc067f4ba55a0590bb7b8418 100644 (file)
@@ -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" : "");