Browse code

Make ffserver show each launched commandline just before to launch them rather than print them when parsing the configuration file. This way those commandlines are not showed anymore in no-launch mode.

Originally committed as revision 13950 to svn://svn.ffmpeg.org/ffmpeg/trunk

Stefano Sabatini authored on 2008/06/25 06:26:20
Showing 1 changed files
... ...
@@ -407,6 +407,23 @@ static void start_children(FFStream *feed)
407 407
                 char *slash;
408 408
                 int i;
409 409
 
410
+                av_strlcpy(pathname, my_program_name, sizeof(pathname));
411
+
412
+                slash = strrchr(pathname, '/');
413
+                if (!slash)
414
+                    slash = pathname;
415
+                else
416
+                    slash++;
417
+                strcpy(slash, "ffmpeg");
418
+
419
+                if (ffserver_debug) {
420
+                    fprintf(stdout, "Launch commandline: ");
421
+                    fprintf(stdout, "%s ", pathname);
422
+                    for (i = 1; feed->child_argv[i] && feed->child_argv[i][0]; i++)
423
+                        fprintf(stdout, "%s ", feed->child_argv[i]);
424
+                    fprintf(stdout, "\n");
425
+                }
426
+
410 427
                 for (i = 3; i < 256; i++)
411 428
                     close(i);
412 429
 
... ...
@@ -420,15 +437,6 @@ static void start_children(FFStream *feed)
420 420
                     }
421 421
                 }
422 422
 
423
-                av_strlcpy(pathname, my_program_name, sizeof(pathname));
424
-
425
-                slash = strrchr(pathname, '/');
426
-                if (!slash)
427
-                    slash = pathname;
428
-                else
429
-                    slash++;
430
-                strcpy(slash, "ffmpeg");
431
-
432 423
                 /* This is needed to make relative pathnames work */
433 424
                 chdir(my_program_dir);
434 425
 
... ...
@@ -3883,15 +3891,6 @@ static int parse_ffconfig(const char *filename)
3883 3883
                         (my_http_addr.sin_addr.s_addr == INADDR_ANY) ? "127.0.0.1" :
3884 3884
                     inet_ntoa(my_http_addr.sin_addr),
3885 3885
                     ntohs(my_http_addr.sin_port), feed->filename);
3886
-
3887
-                if (ffserver_debug)
3888
-                {
3889
-                    int j;
3890
-                    fprintf(stdout, "Launch commandline: ");
3891
-                    for (j = 0; j <= i; j++)
3892
-                        fprintf(stdout, "%s ", feed->child_argv[j]);
3893
-                    fprintf(stdout, "\n");
3894
-                }
3895 3886
             }
3896 3887
         } else if (!strcasecmp(cmd, "ReadOnlyFile")) {
3897 3888
             if (feed) {