changeset 6335:5d04171d705b libavformat

rtsp: Move the definition of SDP_MAX_SIZE up, use it in the RTSP muxer, too
author mstorsjo
date Wed, 28 Jul 2010 09:26:15 +0000
parents 67c36f475c54
children 9bd0ce3f9b64
files rtsp.c
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/rtsp.c	Wed Jul 28 08:17:02 2010 +0000
+++ b/rtsp.c	Wed Jul 28 09:26:15 2010 +0000
@@ -52,6 +52,7 @@
 #define SELECT_TIMEOUT_MS 100
 #define READ_PACKET_TIMEOUT_S 10
 #define MAX_TIMEOUTS READ_PACKET_TIMEOUT_S * 1000 / SELECT_TIMEOUT_MS
+#define SDP_MAX_SIZE 8192
 
 static void get_word_until_chars(char *buf, int buf_size,
                                  const char *sep, const char **pp)
@@ -1295,7 +1296,7 @@
     rt->start_time = av_gettime();
 
     /* Announce the stream */
-    sdp = av_mallocz(8192);
+    sdp = av_mallocz(SDP_MAX_SIZE);
     if (sdp == NULL)
         return AVERROR(ENOMEM);
     /* We create the SDP based on the RTSP AVFormatContext where we
@@ -1314,7 +1315,7 @@
     ff_url_join(sdp_ctx.filename, sizeof(sdp_ctx.filename),
                 "rtsp", NULL, addr, -1, NULL);
     ctx_array[0] = &sdp_ctx;
-    if (avf_sdp_create(ctx_array, 1, sdp, 8192)) {
+    if (avf_sdp_create(ctx_array, 1, sdp, SDP_MAX_SIZE)) {
         av_free(sdp);
         return AVERROR_INVALIDDATA;
     }
@@ -2003,8 +2004,6 @@
     return 0;
 }
 
-#define SDP_MAX_SIZE 8192
-
 static int sdp_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     RTSPState *rt = s->priv_data;