Skip to content

Commit

Permalink
allow set custom latency in SRT url
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroSG94 committed Dec 7, 2024
1 parent 2707c46 commit 3e54601
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions srt/src/main/java/com/pedro/srt/srt/SrtClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ class SrtClient(private val connectChecker: ConnectChecker) {
val host = urlParser.host
val port = urlParser.port ?: 8888
val path = urlParser.getQuery("streamid") ?: urlParser.getFullPath()
val latency = urlParser.getQuery("latency")?.toIntOrNull() ?: 120_000 //latency in micro
if (path.isEmpty()) {
isStreaming = false
onMainThread {
Expand All @@ -221,6 +222,8 @@ class SrtClient(private val connectChecker: ConnectChecker) {
flags = ExtensionContentFlag.TSBPDSND.value or ExtensionContentFlag.TSBPDRCV.value or
ExtensionContentFlag.CRYPT.value or ExtensionContentFlag.TLPKTDROP.value or
ExtensionContentFlag.PERIODICNAK.value or ExtensionContentFlag.REXMITFLG.value,
receiverDelay = latency / 1000,
senderDelay = latency / 1000,
path = path,
encryptInfo = commandsManager.getEncryptInfo()
)))
Expand Down

0 comments on commit 3e54601

Please sign in to comment.