[FFmpeg-cvslog] ffserver: reindent start_children()

Reynaldo H. Verdejo Pinochet git at videolan.org
Fri Dec 26 21:46:34 CET 2014


ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet <reynaldo at osg.samsung.com> | Tue Dec  9 03:03:41 2014 -0300| [18011888cc8791ab6c3d1a3563ff62a834f77a92] | committer: Reynaldo H. Verdejo Pinochet

ffserver: reindent start_children()

Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo at osg.samsung.com>

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

 ffserver.c |   56 +++++++++++++++++++++++++++-----------------------------
 1 file changed, 27 insertions(+), 29 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index d1e6638..94d315f 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -407,43 +407,41 @@ static void start_children(FFServerStream *feed)
         if (!feed->child_argv || feed->pid)
             continue;
 
-            feed->pid_start = time(0);
+        feed->pid_start = time(0);
 
-            feed->pid = fork();
-
-            if (feed->pid < 0) {
-                http_log("Unable to create children\n");
-                exit(1);
-            }
-
-            if (feed->pid)
-                continue;
+        feed->pid = fork();
+        if (feed->pid < 0) {
+            http_log("Unable to create children\n");
+            exit(1);
+        }
 
-                /* In child */
+        if (feed->pid)
+            continue;
 
-                http_log("Launch command line: ");
-                http_log("%s ", pathname);
-                for (i = 1; feed->child_argv[i] && feed->child_argv[i][0]; i++)
-                    http_log("%s ", feed->child_argv[i]);
-                http_log("\n");
+        /* In child */
 
-                for (i = 3; i < 256; i++)
-                    close(i);
+        http_log("Launch command line: ");
+        http_log("%s ", pathname);
 
-                if (!config.debug) {
-                    if (!freopen("/dev/null", "r", stdin))
-                        http_log("failed to redirect STDIN to /dev/null\n;");
-                    if (!freopen("/dev/null", "w", stdout))
-                        http_log("failed to redirect STDOUT to /dev/null\n;");
-                    if (!freopen("/dev/null", "w", stderr))
-                        http_log("failed to redirect STDERR to /dev/null\n;");
-                }
+        for (i = 1; feed->child_argv[i] && feed->child_argv[i][0]; i++)
+            http_log("%s ", feed->child_argv[i]);
+        http_log("\n");
 
-                signal(SIGPIPE, SIG_DFL);
+        for (i = 3; i < 256; i++)
+            close(i);
 
-                execvp(pathname, feed->child_argv);
+        if (!config.debug) {
+            if (!freopen("/dev/null", "r", stdin))
+                http_log("failed to redirect STDIN to /dev/null\n;");
+            if (!freopen("/dev/null", "w", stdout))
+                http_log("failed to redirect STDOUT to /dev/null\n;");
+            if (!freopen("/dev/null", "w", stderr))
+                http_log("failed to redirect STDERR to /dev/null\n;");
+        }
 
-                _exit(1);
+        signal(SIGPIPE, SIG_DFL);
+        execvp(pathname, feed->child_argv);
+        _exit(1);
     }
 }
 



More information about the ffmpeg-cvslog mailing list