]> git.sesse.net Git - nageru/commitdiff
Add a flag to disable ALSA monitoring output.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 30 Apr 2016 23:50:18 +0000 (01:50 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 30 Apr 2016 23:50:27 +0000 (01:50 +0200)
flags.cpp
flags.h
mixer.cpp

index c2dd153ed537172538119c1d0049e4e32c1aa32c..f782c769cbc0329aacce8178c40a08442e03bdbc 100644 (file)
--- a/flags.cpp
+++ b/flags.cpp
@@ -34,6 +34,7 @@ void usage()
        fprintf(stderr, "      --http-coarse-timebase      use less timebase for HTTP (recommended for muxers\n");
        fprintf(stderr, "                                  that handle large pts poorly, like e.g. MP4)\n");
        fprintf(stderr, "      --flat-audio                start with most audio processing turned off\n");
+       fprintf(stderr, "      --disable-alsa-output       disable audio monitoring via ALSA\n");
        fprintf(stderr, "      --no-flush-pbos             do not explicitly signal texture data uploads\n");
        fprintf(stderr, "                                    (will give display corruption, but makes it\n");
        fprintf(stderr, "                                    possible to run with apitrace in real time)\n");
@@ -58,6 +59,7 @@ void parse_flags(int argc, char * const argv[])
                { "http-audio-codec", required_argument, 0, 1006 },
                { "http-audio-bitrate", required_argument, 0, 1007 },
                { "flat-audio", no_argument, 0, 1002 },
+               { "disable-alsa-output", no_argument, 0, 1014 },
                { "no-flush-pbos", no_argument, 0, 1003 },
                { 0, 0, 0, 0 }
        };
@@ -114,6 +116,9 @@ void parse_flags(int argc, char * const argv[])
                case 1002:
                        global_flags.flat_audio = true;
                        break;
+               case 1014:
+                       global_flags.enable_alsa_output = false;
+                       break;
                case 1003:
                        global_flags.flush_pbos = false;
                        break;
diff --git a/flags.h b/flags.h
index 0f27cf205b749558ab342bd5344491677619ceb8..0c01ab1d4c57d75686276104c5cb4c4cc651d061 100644 (file)
--- a/flags.h
+++ b/flags.h
@@ -22,6 +22,7 @@ struct Flags {
        int x264_bitrate = DEFAULT_X264_OUTPUT_BIT_RATE;  // In kilobit/sec.
        int x264_vbv_max_bitrate = -1;  // In kilobits. 0 = no limit, -1 = same as <x264_bitrate> (CBR).
        int x264_vbv_buffer_size = -1;  // In kilobits. 0 = one-frame VBV, -1 = same as <x264_bitrate> (one-second VBV).
+       bool enable_alsa_output = true;
 };
 extern Flags global_flags;
 
index d84754e2bcb40b494e7eeb2e6dbdd1518ec10791..cbc14f2784c34af19edad47337aa698b4eafeb5d 100644 (file)
--- a/mixer.cpp
+++ b/mixer.cpp
@@ -256,7 +256,9 @@ Mixer::Mixer(const QSurfaceFormat &format, unsigned num_cards)
        // and there's a limit to how important the peak meter is.
        peak_resampler.setup(OUTPUT_FREQUENCY, OUTPUT_FREQUENCY * 4, /*num_channels=*/2, /*hlen=*/16, /*frel=*/1.0);
 
-       alsa.reset(new ALSAOutput(OUTPUT_FREQUENCY, /*num_channels=*/2));
+       if (global_flags.enable_alsa_output) {
+               alsa.reset(new ALSAOutput(OUTPUT_FREQUENCY, /*num_channels=*/2));
+       }
 }
 
 Mixer::~Mixer()