From c761b4e9b86014a86a85193dc7486295e898b37d Mon Sep 17 00:00:00 2001 From: Cesar Mendivil Date: Sat, 14 Mar 2026 12:40:00 -0700 Subject: [PATCH] fix: normalize WHIP placeholder format in address resolution --- restream/restream.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/restream/restream.go b/restream/restream.go index 910dd9b7..40ef4406 100644 --- a/restream/restream.go +++ b/restream/restream.go @@ -28,6 +28,11 @@ import ( "github.com/Masterminds/semver/v3" ) +// whipPlaceholderRe matches the {whip:name=} format emitted by the +// Restreamer UI. The replacer engine expects {whip,name=} (comma +// separated params), so we normalize before expansion. +var whipPlaceholderRe = regexp.MustCompile(`\{whip:name=([^}]+)\}`) + // The Restreamer interface type Restreamer interface { ID() string // ID of this instance @@ -1546,6 +1551,8 @@ func resolvePlaceholders(config *app.Config, r replace.Replacer) { input.Address = r.Replace(input.Address, "fs:*", "", vars, config, "input") input.Address = r.Replace(input.Address, "rtmp", "", vars, config, "input") input.Address = r.Replace(input.Address, "srt", "", vars, config, "input") + // Normalize {whip:name=X} (UI format) → {whip,name=X} (replacer format) + input.Address = whipPlaceholderRe.ReplaceAllString(input.Address, "{whip,name=$1}") input.Address = r.Replace(input.Address, "whip", "", vars, config, "input") // WHIP SDP relay URLs (http://…/whip/…/sdp) require FFmpeg to open nested