]> git.sesse.net Git - nageru/commitdiff
Remove/hide some SRT flags if not compiling with SRT.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 4 Aug 2023 22:37:36 +0000 (00:37 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 4 Aug 2023 22:37:36 +0000 (00:37 +0200)
nageru/flags.cpp

index 0a2776f6b262fa09f0497266ad53595fc2601d4b..3c1575589b6a33169e1f922c9eb726fd55218188 100644 (file)
@@ -203,9 +203,11 @@ void usage(Program program)
                DEFAULT_AUDIO_OUTPUT_BIT_RATE / 1000);
        fprintf(stderr, "      --http-port=PORT            which port to use for the built-in HTTP server\n");
        fprintf(stderr, "                                  (default is %d)\n", DEFAULT_HTTPD_PORT);
                DEFAULT_AUDIO_OUTPUT_BIT_RATE / 1000);
        fprintf(stderr, "      --http-port=PORT            which port to use for the built-in HTTP server\n");
        fprintf(stderr, "                                  (default is %d)\n", DEFAULT_HTTPD_PORT);
+#ifdef HAVE_SRT
        fprintf(stderr, "      --srt-port=PORT             which port to use for receiving SRT streams\n");
        fprintf(stderr, "                                  (default is %d)\n", DEFAULT_SRT_PORT);
        fprintf(stderr, "      --no-srt                    disable receiving SRT streams\n");
        fprintf(stderr, "      --srt-port=PORT             which port to use for receiving SRT streams\n");
        fprintf(stderr, "                                  (default is %d)\n", DEFAULT_SRT_PORT);
        fprintf(stderr, "      --no-srt                    disable receiving SRT streams\n");
+#endif
        if (program == PROGRAM_KAERU) {
                fprintf(stderr, "      --no-transcode-video        copy encoded video raw from the source stream\n");
                fprintf(stderr, "                                    (experimental, must be H.264)\n");
        if (program == PROGRAM_KAERU) {
                fprintf(stderr, "      --no-transcode-video        copy encoded video raw from the source stream\n");
                fprintf(stderr, "                                    (experimental, must be H.264)\n");
@@ -300,8 +302,10 @@ void parse_flags(Program program, int argc, char * const argv[])
                { "http-audio-codec", required_argument, 0, OPTION_HTTP_AUDIO_CODEC },
                { "http-audio-bitrate", required_argument, 0, OPTION_HTTP_AUDIO_BITRATE },
                { "http-port", required_argument, 0, OPTION_HTTP_PORT },
                { "http-audio-codec", required_argument, 0, OPTION_HTTP_AUDIO_CODEC },
                { "http-audio-bitrate", required_argument, 0, OPTION_HTTP_AUDIO_BITRATE },
                { "http-port", required_argument, 0, OPTION_HTTP_PORT },
+#ifdef HAVE_SRT
                { "srt-port", required_argument, 0, OPTION_SRT_PORT },
                { "srt-port", required_argument, 0, OPTION_SRT_PORT },
-               { "no-srt", no_argument, 0, OPTION_NO_SRT },
+#endif
+               { "no-srt", no_argument, 0, OPTION_NO_SRT },  // We silently allow this even without HAVE_SRT.
                { "no-transcode-video", no_argument, 0, OPTION_NO_TRANSCODE_VIDEO },
                { "no-transcode-audio", no_argument, 0, OPTION_NO_TRANSCODE_AUDIO },
                { "disable-audio", no_argument, 0, OPTION_DISABLE_AUDIO },
                { "no-transcode-video", no_argument, 0, OPTION_NO_TRANSCODE_VIDEO },
                { "no-transcode-audio", no_argument, 0, OPTION_NO_TRANSCODE_AUDIO },
                { "disable-audio", no_argument, 0, OPTION_DISABLE_AUDIO },
@@ -434,9 +438,11 @@ void parse_flags(Program program, int argc, char * const argv[])
                case OPTION_HTTP_PORT:
                        global_flags.http_port = atoi(optarg);
                        break;
                case OPTION_HTTP_PORT:
                        global_flags.http_port = atoi(optarg);
                        break;
+#ifdef HAVE_SRT
                case OPTION_SRT_PORT:
                        global_flags.srt_port = atoi(optarg);
                        break;
                case OPTION_SRT_PORT:
                        global_flags.srt_port = atoi(optarg);
                        break;
+#endif
                case OPTION_NO_SRT:
                        global_flags.srt_port = -1;
                        break;
                case OPTION_NO_SRT:
                        global_flags.srt_port = -1;
                        break;