licence();
show_license();
int main(int argc, char **argv){    const char *config_filename;    int c;    struct sigaction sigact;    av_register_all();    config_filename = "/etc/ffserver.conf";    my_program_name = argv[0];    my_program_dir = getcwd(0, 0);    ffserver_daemon = 1;        for(;;) {        c = getopt(argc, argv, "ndLh?f:");        if (c == -1)            break;        switch(c) {        case 'L':            licence();            exit(1);        case '?':        case 'h':            help();            exit(1);        case 'n':            no_launch = 1;            break;        case 'd':            ffserver_debug = 1;            ffserver_daemon = 0;            break;        case 'f':            config_filename = optarg;            break;        default:            exit(2);        }    }    putenv("http_proxy");               /* Kill the http_proxy */    srandom(gettime_ms() + (getpid() << 16));    /* address on which the server will handle HTTP connections */    my_http_addr.sin_family = AF_INET;    my_http_addr.sin_port = htons (8080);    my_http_addr.sin_addr.s_addr = htonl (INADDR_ANY);    /* address on which the server will handle RTSP connections */    my_rtsp_addr.sin_family = AF_INET;    my_rtsp_addr.sin_port = htons (5454);    my_rtsp_addr.sin_addr.s_addr = htonl (INADDR_ANY);        nb_max_connections = 5;    max_bandwidth = 1000;    first_stream = NULL;    logfilename[0] = '\0';    memset(&sigact, 0, sizeof(sigact));    sigact.sa_handler = handle_child_exit;    sigact.sa_flags = SA_NOCLDSTOP | SA_RESTART;    sigaction(SIGCHLD, &sigact, 0);    if (parse_ffconfig(config_filename) < 0) {        fprintf(stderr, "Incorrect config file - exiting.\n");        exit(1);    }    build_file_streams();    build_feed_streams();    compute_bandwidth();    /* put the process in background and detach it from its TTY */    if (ffserver_daemon) {        int pid;        pid = fork();        if (pid < 0) {            perror("fork");            exit(1);        } else if (pid > 0) {            /* parent : exit */            exit(0);        } else {            /* child */            setsid();            chdir("/");            close(0);            open("/dev/null", O_RDWR);            if (strcmp(logfilename, "-") != 0) {                close(1);                dup(0);            }            close(2);            dup(0);        }    }    /* signal init */    signal(SIGPIPE, SIG_IGN);    /* open log file if needed */    if (logfilename[0] != '\0') {        if (!strcmp(logfilename, "-"))            logfile = stdout;        else            logfile = fopen(logfilename, "w");    }    if (http_server() < 0) {        fprintf(stderr, "Could not start server\n");        exit(1);    }    return 0;}