rtspsrc: Parse Speed/Scale before Range in responses

Parse the speed and scale in the server's response
*before* the range, so that the range start/stop
are swapped (or not swapped) correctly based
on the server's actual chosen values. Otherwise,
the old rate from the segment is used - what the
last seek asked for, but not necessarily what
the server chooses.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6287>
This commit is contained in:
Jan Schmidt 2024-03-01 02:44:57 +11:00 committed by Tim-Philipp Müller
parent 6a07ced605
commit 375d16a9fa

View file

@ -9022,12 +9022,6 @@ restart:
gst_rtsp_message_unset (&request);
/* parse RTP npt field. This is the current position in the stream (Normal
* Play Time) and should be put in the NEWSEGMENT position field. */
if (gst_rtsp_message_get_header (&response, GST_RTSP_HDR_RANGE, &hval,
0) == GST_RTSP_OK)
gst_rtspsrc_parse_range (src, hval, segment, FALSE);
/* assume 1.0 rate now, overwrite when the SCALE or SPEED headers are present. */
segment->rate = 1.0;
@ -9041,6 +9035,12 @@ restart:
segment->rate = gst_rtspsrc_get_float (hval);
}
/* parse RTP npt field. This is the current position in the stream (Normal
* Play Time) and should be put in the NEWSEGMENT position field. */
if (gst_rtsp_message_get_header (&response, GST_RTSP_HDR_RANGE, &hval,
0) == GST_RTSP_OK)
gst_rtspsrc_parse_range (src, hval, segment, FALSE);
/* parse the RTP-Info header field (if ANY) to get the base seqnum and timestamp
* for the RTP packets. If this is not present, we assume all starts from 0...
* This is info for the RTP session manager that we pass to it in caps. */