@@ -2546,8 +2546,9 @@ srs_error_t SrsConfig::check_normal_config()
2546
2546
&& n != " mss" && n != " latency" && n != " recvlatency"
2547
2547
&& n != " peerlatency" && n != " tlpkdrop" && n != " connect_timeout"
2548
2548
&& n != " sendbuf" && n != " recvbuf" && n != " payloadsize"
2549
- && n != " default_app" && n != " mix_correct" && n != " sei_filter" ) {
2550
- return srs_error_new (ERROR_SYSTEM_CONFIG_INVALID, " illegal srt_stream.%s" , n.c_str ());
2549
+ && n != " default_app" && n != " mix_correct" && n != " sei_filter"
2550
+ && n != " tlpktdrop" && n != " tsbpdmode" ) {
2551
+ return srs_error_new (ERROR_SYSTEM_CONFIG_INVALID, " illegal srt_server.%s" , n.c_str ());
2551
2552
}
2552
2553
}
2553
2554
}
@@ -6798,6 +6799,20 @@ int SrsConfig::get_srto_mss() {
6798
6799
return atoi (conf->arg0 ().c_str ());
6799
6800
}
6800
6801
6802
+ bool SrsConfig::get_srto_tsbpdmode () {
6803
+ static bool DEFAULT = false ;
6804
+ SrsConfDirective* conf = root->get (" srt_server" );
6805
+ if (!conf) {
6806
+ return DEFAULT;
6807
+ }
6808
+
6809
+ conf = conf->get (" tsbpdmode" );
6810
+ if (!conf || conf->arg0 ().empty ()) {
6811
+ return DEFAULT;
6812
+ }
6813
+ return SRS_CONF_PERFER_TRUE (conf->arg0 ());
6814
+ }
6815
+
6801
6816
int SrsConfig::get_srto_latency () {
6802
6817
static int DEFAULT = 120 ;
6803
6818
SrsConfDirective* conf = root->get (" srt_server" );
@@ -6854,14 +6869,18 @@ bool SrsConfig::get_srt_sei_filter() {
6854
6869
return SRS_CONF_PERFER_TRUE (conf->arg0 ());
6855
6870
}
6856
6871
6857
- bool SrsConfig::get_srto_tlpkdrop () {
6872
+ bool SrsConfig::get_srto_tlpktdrop () {
6858
6873
static bool DEFAULT = true ;
6859
- SrsConfDirective* conf = root->get (" srt_server" );
6860
- if (!conf ) {
6874
+ SrsConfDirective* srt_server_conf = root->get (" srt_server" );
6875
+ if (!srt_server_conf ) {
6861
6876
return DEFAULT;
6862
6877
}
6863
6878
6864
- conf = conf->get (" tlpkdrop" );
6879
+ SrsConfDirective* conf = srt_server_conf->get (" tlpkdrop" );
6880
+ if (! conf) {
6881
+ // make it compatible tlpkdrop and tlpktdrop opt.
6882
+ conf = srt_server_conf->get (" tlpktdrop" );
6883
+ }
6865
6884
if (!conf || conf->arg0 ().empty ()) {
6866
6885
return DEFAULT;
6867
6886
}
@@ -6882,6 +6901,20 @@ int SrsConfig::get_srto_conntimeout() {
6882
6901
return atoi (conf->arg0 ().c_str ());
6883
6902
}
6884
6903
6904
+ int SrsConfig::get_srto_peeridletimeout () {
6905
+ static int DEFAULT = 10000 ;
6906
+ SrsConfDirective* conf = root->get (" srt_server" );
6907
+ if (!conf) {
6908
+ return DEFAULT;
6909
+ }
6910
+
6911
+ conf = conf->get (" peer_idle_timeout" );
6912
+ if (!conf || conf->arg0 ().empty ()) {
6913
+ return DEFAULT;
6914
+ }
6915
+ return atoi (conf->arg0 ().c_str ());
6916
+ }
6917
+
6885
6918
int SrsConfig::get_srto_sendbuf () {
6886
6919
static int64_t DEFAULT = 8192 * (1500 -28 );
6887
6920
SrsConfDirective* conf = root->get (" srt_server" );
0 commit comments