From 92f9ee7b78aa054aa9c5514844907082b00ad628 Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Sat, 31 Jan 2026 15:29:24 +0100 Subject: [PATCH] deprecate fallback (#5388) The fallback feature worked with RTSP only and did not allow readers to resume the original stream. It has been replaced by alwaysAvailable. --- api/openapi.yaml | 2 -- internal/conf/path.go | 7 ++++--- internal/core/path.go | 4 ++-- mediamtx.yml | 3 --- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 7a12d3f4..64a82f80 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -372,8 +372,6 @@ components: format: int64 srtReadPassphrase: type: string - fallback: - type: string useAbsoluteTimestamp: type: boolean diff --git a/internal/conf/path.go b/internal/conf/path.go index fe31a47e..9042fb9c 100644 --- a/internal/conf/path.go +++ b/internal/conf/path.go @@ -148,7 +148,7 @@ type Path struct { SourceOnDemandCloseAfter Duration `json:"sourceOnDemandCloseAfter"` MaxReaders int `json:"maxReaders"` SRTReadPassphrase string `json:"srtReadPassphrase"` - Fallback string `json:"fallback"` + Fallback *string `json:"fallback,omitempty"` // deprecated UseAbsoluteTimestamp bool `json:"useAbsoluteTimestamp"` // Always available @@ -662,8 +662,9 @@ func (pconf *Path) validate( } } - if pconf.Fallback != "" { - err := checkRedirect(pconf.Fallback) + if pconf.Fallback != nil { + l.Log(logger.Warn, "the 'fallback' feature is deprecated, use 'alwaysAvailable' instead") + err := checkRedirect(*pconf.Fallback) if err != nil { return err } diff --git a/internal/core/path.go b/internal/core/path.go index f2609eaf..ccbeb6b8 100644 --- a/internal/core/path.go +++ b/internal/core/path.go @@ -480,8 +480,8 @@ func (pa *path) doDescribe(req defs.PathDescribeReq) { return } - if pa.conf.Fallback != "" { - req.Res <- defs.PathDescribeRes{Redirect: pa.conf.Fallback} + if pa.conf.Fallback != nil { + req.Res <- defs.PathDescribeRes{Redirect: *pa.conf.Fallback} return } diff --git a/mediamtx.yml b/mediamtx.yml index d618c547..cdfeccc9 100644 --- a/mediamtx.yml +++ b/mediamtx.yml @@ -480,9 +480,6 @@ pathDefaults: maxReaders: 0 # SRT encryption passphrase required to read from this path. srtReadPassphrase: - # If the stream is not available, redirect readers to this path. - # It can be can be a relative path (i.e. /otherstream) or an absolute RTSP URL. - fallback: # Use absolute timestamp of frames, instead of replacing them with the current time. useAbsoluteTimestamp: false