]> git.sesse.net Git - ffmpeg/blobdiff - ffserver.c
always use stdout to log when running in debug mode
[ffmpeg] / ffserver.c
index 15b815f41ae6fefb2ef632406374c631cb06cc6c..cec0e824259519b18a349d7ecfd6a50fb908ae31 100644 (file)
@@ -654,8 +654,10 @@ static void new_connection(int server_fd, int is_rtsp)
     len = sizeof(from_addr);
     fd = accept(server_fd, (struct sockaddr *)&from_addr,
                 &len);
-    if (fd < 0)
+    if (fd < 0) {
+        http_log("error during accept %s\n", strerror(errno));
         return;
+    }
     ff_socket_nonblock(fd, 1);
 
     /* XXX: should output a warning page when coming
@@ -2171,6 +2173,9 @@ static int http_prepare_data(HTTPContext *c)
                         pkt.pts = av_rescale_q(pkt.pts,
                                                c->fmt_in->streams[source_index]->time_base,
                                                ctx->streams[pkt.stream_index]->time_base);
+                    pkt.duration = av_rescale_q(pkt.duration,
+                                                c->fmt_in->streams[source_index]->time_base,
+                                                ctx->streams[pkt.stream_index]->time_base);
                     if (av_write_frame(ctx, &pkt) < 0) {
                         http_log("Error writing frame to output\n");
                         c->state = HTTPSTATE_SEND_DATA_TRAILER;
@@ -3786,7 +3791,8 @@ static int parse_ffconfig(const char *filename)
             } else
                 max_bandwidth = llval;
         } else if (!strcasecmp(cmd, "CustomLog")) {
-            get_arg(logfilename, sizeof(logfilename), &p);
+            if (!ffserver_debug)
+                get_arg(logfilename, sizeof(logfilename), &p);
         } else if (!strcasecmp(cmd, "<Feed")) {
             /*********************************************/
             /* Feed related options */
@@ -4387,6 +4393,7 @@ static void opt_debug()
 {
     ffserver_debug = 1;
     ffserver_daemon = 0;
+    logfilename[0] = '-';
 }
 
 static void opt_show_help(void)