提交 de478d32 编写于 作者: J jp9000

Change drop threshold to macro, use milliseconds

Like with other plugins, a macro is ideal for preventing typos and
misspellings of the setting.  Also, add a property for drop threshold.
上级 a527f30b
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#include "librtmp/log.h" #include "librtmp/log.h"
#include "flv-mux.h" #include "flv-mux.h"
#define OPT_DROP_THRESHOLD "drop_threshold_ms"
//#define TEST_FRAMEDROPS //#define TEST_FRAMEDROPS
struct rtmp_stream { struct rtmp_stream {
...@@ -417,7 +419,7 @@ static bool rtmp_stream_start(void *data) ...@@ -417,7 +419,7 @@ static bool rtmp_stream_start(void *data)
dstr_copy(&stream->username, obs_service_get_username(service)); dstr_copy(&stream->username, obs_service_get_username(service));
dstr_copy(&stream->password, obs_service_get_password(service)); dstr_copy(&stream->password, obs_service_get_password(service));
stream->drop_threshold_usec = stream->drop_threshold_usec =
(int64_t)obs_data_getint(settings, "drop_threshold"); (int64_t)obs_data_getint(settings, OPT_DROP_THRESHOLD) * 1000;
obs_data_release(settings); obs_data_release(settings);
return pthread_create(&stream->connect_thread, NULL, connect_thread, return pthread_create(&stream->connect_thread, NULL, connect_thread,
...@@ -541,7 +543,7 @@ static void rtmp_stream_data(void *data, struct encoder_packet *packet) ...@@ -541,7 +543,7 @@ static void rtmp_stream_data(void *data, struct encoder_packet *packet)
static void rtmp_stream_defaults(obs_data_t defaults) static void rtmp_stream_defaults(obs_data_t defaults)
{ {
obs_data_set_default_int(defaults, "drop_threshold", 600000); obs_data_set_default_int(defaults, OPT_DROP_THRESHOLD, 600);
} }
static obs_properties_t rtmp_stream_properties(void) static obs_properties_t rtmp_stream_properties(void)
...@@ -549,6 +551,8 @@ static obs_properties_t rtmp_stream_properties(void) ...@@ -549,6 +551,8 @@ static obs_properties_t rtmp_stream_properties(void)
obs_properties_t props = obs_properties_create(); obs_properties_t props = obs_properties_create();
/* TODO: locale */ /* TODO: locale */
obs_properties_add_int(props, OPT_DROP_THRESHOLD,
"Drop threshold (milliseconds)", 200, 10000, 100);
return props; return props;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册