X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mixer.cpp;h=5fa13d5cc224890a7050f04642538ad2a3e3b84d;hb=194872611b21bb070f4dfcf5beda6c36d25459ea;hp=0e362f069395874c837dac1bf732c9e1d32d25a0;hpb=beaf0e95b0e474c3088ee8ee74191b6c504fef82;p=nageru diff --git a/mixer.cpp b/mixer.cpp index 0e362f0..5fa13d5 100644 --- a/mixer.cpp +++ b/mixer.cpp @@ -157,6 +157,8 @@ Mixer::Mixer(const QSurfaceFormat &format, unsigned num_cards) // hlen=16 is pretty low quality, but we use quite a bit of CPU otherwise, // 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); + + alsa.reset(new ALSAOutput(OUTPUT_FREQUENCY, /*num_channels=*/2)); } Mixer::~Mixer() @@ -623,7 +625,12 @@ void Mixer::process_audio_one_frame() float *ptrs[] = { left.data(), right.data() }; r128.process(left.size(), ptrs); - // Actually add the samples to the output. + // Send the samples to the sound card. + if (alsa) { + alsa->write(samples_out); + } + + // And finally add them to the output. h264_encoder->add_audio(pts_int, move(samples_out)); }