Skip to content
Snippets Groups Projects
ffserver.c 65.1 KiB
Newer Older
  • Learn to ignore specific revisions
  • Fabrice Bellard's avatar
    Fabrice Bellard committed
        }
    
        /* address on which the server will handle connections */
        my_addr.sin_family = AF_INET;
        my_addr.sin_port = htons (8080);
        my_addr.sin_addr.s_addr = htonl (INADDR_ANY);
        nb_max_connections = 5;
    
        nb_max_bandwidth = 1000;
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
        first_stream = NULL;
        logfilename[0] = '\0';
    
        if (parse_ffconfig(config_filename) < 0) {
            fprintf(stderr, "Incorrect config file - exiting.\n");
            exit(1);
        }
    
        build_feed_streams();
    
        /* 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(my_addr) < 0) {
            fprintf(stderr, "Could start http server\n");
            exit(1);
        }
    
        return 0;
    }