Commit 46508527d5 for ffmpeg

commit 46508527d52a80ffb754a6491d7220da771955c9
Author: Michael Niedermayer <michael@niedermayer.cc>
Date:   Thu Dec 3 08:10:19 2026 +0000

    tests/fate: check an SDP range given in two time formats

    An unsupported clock range following the equivalent NPT range should preserve both the start time and duration.

    Assisted-by: Fairy

diff --git a/tests/fate/rtsp.mak b/tests/fate/rtsp.mak
index 83bc1ac887..380d5b44e0 100644
--- a/tests/fate/rtsp.mak
+++ b/tests/fate/rtsp.mak
@@ -1,5 +1,6 @@
 FATE_RTSP_FFPROBE-$(call ALLYES, SDP_DEMUXER PIPE_PROTOCOL) \
-                               += fate-rtsp-sdp-sample-rate \
+                               += fate-rtsp-sdp-range-mixed \
+                                  fate-rtsp-sdp-sample-rate \
                                   fate-rtsp-sdp-sample-rate-leading-zero \
                                   fate-rtsp-sdp-sample-rate-negative \
                                   fate-rtsp-sdp-sample-rate-zero \
@@ -7,19 +8,16 @@ FATE_RTSP_FFPROBE-$(call ALLYES, SDP_DEMUXER PIPE_PROTOCOL) \
                                   fate-rtsp-sdp-sample-rate-above-int-max \
                                   fate-rtsp-sdp-sample-rate-overflow

-# The RealNetworks "SampleRate:integer;" attribute overrides the rate the
-# rtpmap line established. Every description below keeps the rtpmap rate at
-# 44100 while the attribute asks for something else, so the probed rate tells
-# whether the attribute was applied or ignored. custom_io keeps the demuxer
-# from opening a transport, which keeps these tests offline.
-SDP_SAMPLE_RATE_HEAD = v=0\no=- 0 0 IN IP4 127.0.0.1\ns=SampleRate\nc=IN IP4 127.0.0.1\nt=0 0\nm=audio 5004 RTP/AVP 97\na=rtpmap:97 L16/44100/1\n
-SDP_SAMPLE_RATE_PROBE = run ffprobe$(PROGSSUF)$(EXESUF) -v error \
+SDP_AUDIO_HEAD = v=0\no=- 0 0 IN IP4 127.0.0.1\ns=test\nc=IN IP4 127.0.0.1\nt=0 0\nm=audio 5004 RTP/AVP 97\na=rtpmap:97 L16/44100/1\n
+# custom_io keeps these probes offline.
+SDP_PROBE = run ffprobe$(PROGSSUF)$(EXESUF) -v error \
     -f sdp -sdp_flags custom_io -protocol_whitelist pipe \
-    -analyzeduration 0 -probesize 32 \
-    -show_entries stream=sample_rate -print_format compact
+    -analyzeduration 0 -probesize 32 -print_format compact

+# The RealNetworks SampleRate attribute overrides the rate from rtpmap.
+# Keep the latter at 44100 so the probed rate shows whether the override took effect.
 define FATE_SDP_SAMPLE_RATE_CMD
-    printf "$(SDP_SAMPLE_RATE_HEAD)a=SampleRate:integer;$(1)\n" | $(SDP_SAMPLE_RATE_PROBE) pipe:
+    printf "$(SDP_AUDIO_HEAD)a=SampleRate:integer;$(1)\n" | $(SDP_PROBE) -show_entries stream=sample_rate pipe:
 endef

 # A valid attribute must be applied, otherwise the tests below would pass
@@ -39,6 +37,10 @@ fate-rtsp-sdp-sample-rate-overflow: CMD = $(call FATE_SDP_SAMPLE_RATE_CMD,999999
 fate-rtsp-sdp-sample-rate-int-max: CMD = $(call FATE_SDP_SAMPLE_RATE_CMD,2147483647)
 fate-rtsp-sdp-sample-rate-above-int-max: CMD = $(call FATE_SDP_SAMPLE_RATE_CMD,2147483648)

+# A second time format for the same interval must preserve the NPT timing.
+fate-rtsp-sdp-range-mixed: CMD = printf "$(SDP_AUDIO_HEAD)a=range:npt=10-20\na=range:clock=19971113T211503Z-19971113T211513Z\n" | \
+    $(SDP_PROBE) -show_entries format=start_time,duration pipe:
+
 FATE_FFPROBE += $(FATE_RTSP_FFPROBE-yes)

 fate-rtsp: $(FATE_RTSP_FFPROBE-yes)
diff --git a/tests/ref/fate/rtsp-sdp-range-mixed b/tests/ref/fate/rtsp-sdp-range-mixed
new file mode 100644
index 0000000000..ef54afd98c
--- /dev/null
+++ b/tests/ref/fate/rtsp-sdp-range-mixed
@@ -0,0 +1 @@
+format|start_time=10.000000|duration=10.000000