[FFmpeg-cvslog] avformat/rtsp: move SDP_MAX_SIZE macro definition to header file

Limin Wang git at videolan.org
Wed Nov 11 12:41:13 EET 2020


ffmpeg | branch: master | Limin Wang <lance.lmwang at gmail.com> | Wed Nov 11 18:26:26 2020 +0800| [33f6bb78285f05dbdad476eaf199dae21b7b89df] | committer: Limin Wang

avformat/rtsp: move SDP_MAX_SIZE macro definition to header file

move comments for the size of SDP_MAX_SIZE here:
Some SDP lines, particularly for Realmedia or ASF RTSP streams,
contain long SDP lines containing complete ASF Headers (several
kB) or arrays of MDPR (RM stream descriptor) headers plus
"rulebooks" describing their properties. Therefore, the SDP line
buffer is large.
The Vorbis FMTP line can be up to 16KB - see xiph_parse_sdp_line
in rtpdec_xiph.c.

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=33f6bb78285f05dbdad476eaf199dae21b7b89df
---

 libavformat/rtsp.c    | 9 ---------
 libavformat/rtsp.h    | 1 +
 libavformat/rtspenc.c | 1 -
 3 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 3bc7671a3c..3675045dbc 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -53,7 +53,6 @@
 
 /* Default timeout values for read packet in seconds  */
 #define READ_PACKET_TIMEOUT_S 10
-#define SDP_MAX_SIZE 16384
 #define RECVBUF_SIZE 10 * RTP_MAX_PACKET_LENGTH
 #define DEFAULT_REORDERING_DELAY 100000
 
@@ -688,14 +687,6 @@ int ff_sdp_parse(AVFormatContext *s, const char *content)
 {
     const char *p;
     int letter, i;
-    /* Some SDP lines, particularly for Realmedia or ASF RTSP streams,
-     * contain long SDP lines containing complete ASF Headers (several
-     * kB) or arrays of MDPR (RM stream descriptor) headers plus
-     * "rulebooks" describing their properties. Therefore, the SDP line
-     * buffer is large.
-     *
-     * The Vorbis FMTP line can be up to 16KB - see xiph_parse_sdp_line
-     * in rtpdec_xiph.c. */
     char buf[SDP_MAX_SIZE], *q;
     SDPParseState sdp_parse_state = { { 0 } }, *s1 = &sdp_parse_state;
 
diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
index 2b37f5b49f..251ed86d19 100644
--- a/libavformat/rtsp.h
+++ b/libavformat/rtsp.h
@@ -78,6 +78,7 @@ enum RTSPControlTransport {
 #define RTSP_DEFAULT_AUDIO_SAMPLERATE 44100
 #define RTSP_RTP_PORT_MIN 5000
 #define RTSP_RTP_PORT_MAX 65000
+#define SDP_MAX_SIZE 16384
 
 /**
  * This describes a single item in the "Transport:" line of one stream as
diff --git a/libavformat/rtspenc.c b/libavformat/rtspenc.c
index 97e3ef6da3..d50544456d 100644
--- a/libavformat/rtspenc.c
+++ b/libavformat/rtspenc.c
@@ -34,7 +34,6 @@
 #include "libavutil/time.h"
 #include "url.h"
 
-#define SDP_MAX_SIZE 16384
 
 static const AVClass rtsp_muxer_class = {
     .class_name = "RTSP muxer",



More information about the ffmpeg-cvslog mailing list