]> git.sesse.net Git - ffmpeg/blobdiff - ffserver.c
Help debugging by keeping symbols ans line numbers patch by (Michel Bardiaux <mbardia...
[ffmpeg] / ffserver.c
index eb8b37d0ae7fded662b9455552a7ed9981c88822..c7c7a9f05368d818e6138155647484514a56acbc 100644 (file)
@@ -26,6 +26,7 @@
 #include <sys/poll.h>
 #include <errno.h>
 #include <sys/time.h>
+#undef time //needed because HAVE_AV_CONFIG_H is defined on top
 #include <time.h>
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -599,7 +600,9 @@ static int http_server(void)
            second to handle timeouts */
         do {
             ret = poll(poll_table, poll_entry - poll_table, delay);
-        } while (ret == -1);
+            if (ret < 0 && errno != EAGAIN && errno != EINTR)
+                return -1;
+        } while (ret <= 0);
         
         cur_time = gettime_ms();
 
@@ -1468,7 +1471,7 @@ static int http_parse_request(HTTPContext *c)
                 if (eol) {
                     if (eol[-1] == '\r')
                         eol--;
-                    http_log("%.*s\n", eol - logline, logline);
+                    http_log("%.*s\n", (int) (eol - logline), logline);
                     c->suppress_log = 1;
                 }
             }
@@ -2162,7 +2165,7 @@ static int http_prepare_data(HTTPContext *c)
                             /* XXX: potential leak */
                             return -1;
                         }
-                        if (av_write_frame(ctx, pkt.stream_index, pkt.data, pkt.size)) {
+                        if (av_write_frame(ctx, &pkt)) {
                             c->state = HTTPSTATE_SEND_DATA_TRAILER;
                         }
                         
@@ -2711,7 +2714,7 @@ static void rtsp_cmd_describe(HTTPContext *c, const char *url)
     struct sockaddr_in my_addr;
     
     /* find which url is asked */
-    url_split(NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);
+    url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);
     path = path1;
     if (*path == '/')
         path++;
@@ -2785,7 +2788,7 @@ static void rtsp_cmd_setup(HTTPContext *c, const char *url,
     RTSPActionServerSetup setup;
     
     /* find which url is asked */
-    url_split(NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);
+    url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);
     path = path1;
     if (*path == '/')
         path++;
@@ -2940,7 +2943,7 @@ static HTTPContext *find_rtp_session_with_url(const char *url,
         return NULL;
 
     /* find which url is asked */
-    url_split(NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);
+    url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);
     path = path1;
     if (*path == '/')
         path++;
@@ -3124,7 +3127,7 @@ static int rtp_new_av_stream(HTTPContext *c,
     int max_packet_size;
     
     /* now we can open the relevant output stream */
-    ctx = av_mallocz(sizeof(AVFormatContext));
+    ctx = av_alloc_format_context();
     if (!ctx)
         return -1;
     ctx->oformat = &rtp_mux;
@@ -3634,8 +3637,6 @@ static void add_codec(FFStream *stream, AVCodecContext *av)
             av->b_quant_factor = 1.25;
         if (!av->b_quant_offset)
             av->b_quant_offset = 1.25;
-        if (!av->rc_min_rate)
-            av->rc_min_rate = av->bit_rate / 2;
         if (!av->rc_max_rate)
             av->rc_max_rate = av->bit_rate * 2;
 
@@ -4061,6 +4062,11 @@ static int parse_ffconfig(const char *filename)
                     errors++;
                 }
             }
+        } else if (!strcasecmp(cmd, "VideoBufferSize")) {
+            if (stream) {
+                get_arg(arg, sizeof(arg), &p);
+                video_enc.rc_buffer_size = atoi(arg) * 1024;
+            }
         } else if (!strcasecmp(cmd, "VideoBitRateTolerance")) {
             if (stream) {
                 get_arg(arg, sizeof(arg), &p);