rtsp: Set the default delay to 0.1 s for the RTSP/SDP/RTP demuxers
This enables reordering of UDP packets by default, unless the caller explicitly sets -max_delay 0. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
4fa57d524f
commit
ccfa8aa26f
@ -288,9 +288,9 @@ Accept packets only from negotiated peer address and port.
|
|||||||
@end table
|
@end table
|
||||||
|
|
||||||
When receiving data over UDP, the demuxer tries to reorder received packets
|
When receiving data over UDP, the demuxer tries to reorder received packets
|
||||||
(since they may arrive out of order, or packets may get lost totally). In
|
(since they may arrive out of order, or packets may get lost totally). This
|
||||||
order for this to be enabled, a maximum delay must be specified in the
|
can be disabled by setting the maximum demuxing delay to zero (via
|
||||||
@code{max_delay} field of AVFormatContext.
|
the @code{max_delay} field of AVFormatContext).
|
||||||
|
|
||||||
When watching multi-bitrate Real-RTSP streams with @file{avplay}, the
|
When watching multi-bitrate Real-RTSP streams with @file{avplay}, the
|
||||||
streams to display can be chosen with @code{-vst} @var{n} and
|
streams to display can be chosen with @code{-vst} @var{n} and
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
#define MAX_TIMEOUTS READ_PACKET_TIMEOUT_S * 1000 / POLL_TIMEOUT_MS
|
#define MAX_TIMEOUTS READ_PACKET_TIMEOUT_S * 1000 / POLL_TIMEOUT_MS
|
||||||
#define SDP_MAX_SIZE 16384
|
#define SDP_MAX_SIZE 16384
|
||||||
#define RECVBUF_SIZE 10 * RTP_MAX_PACKET_LENGTH
|
#define RECVBUF_SIZE 10 * RTP_MAX_PACKET_LENGTH
|
||||||
|
#define DEFAULT_REORDERING_DELAY 100000
|
||||||
|
|
||||||
#define OFFSET(x) offsetof(RTSPState, x)
|
#define OFFSET(x) offsetof(RTSPState, x)
|
||||||
#define DEC AV_OPT_FLAG_DECODING_PARAM
|
#define DEC AV_OPT_FLAG_DECODING_PARAM
|
||||||
@ -1427,7 +1428,7 @@ int ff_rtsp_connect(AVFormatContext *s)
|
|||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
|
|
||||||
if (s->max_delay < 0) /* Not set by the caller */
|
if (s->max_delay < 0) /* Not set by the caller */
|
||||||
s->max_delay = 0;
|
s->max_delay = s->iformat ? DEFAULT_REORDERING_DELAY : 0;
|
||||||
|
|
||||||
rt->control_transport = RTSP_MODE_PLAIN;
|
rt->control_transport = RTSP_MODE_PLAIN;
|
||||||
if (rt->lower_transport_mask & (1 << RTSP_LOWER_TRANSPORT_HTTP)) {
|
if (rt->lower_transport_mask & (1 << RTSP_LOWER_TRANSPORT_HTTP)) {
|
||||||
@ -1870,7 +1871,7 @@ static int sdp_read_header(AVFormatContext *s)
|
|||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
|
|
||||||
if (s->max_delay < 0) /* Not set by the caller */
|
if (s->max_delay < 0) /* Not set by the caller */
|
||||||
s->max_delay = 0;
|
s->max_delay = DEFAULT_REORDERING_DELAY;
|
||||||
|
|
||||||
/* read the whole sdp file */
|
/* read the whole sdp file */
|
||||||
/* XXX: better loading */
|
/* XXX: better loading */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user