#include <movit/flat_input.h>
#include <movit/image_format.h>
#include <movit/resource_pool.h>
+#include <movit/util.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
-#include <util.h>
#include <algorithm>
#include <cmath>
#include <condition_variable>
// Insert silence as needed.
fprintf(stderr, "Card %d dropped %d frame(s) (before timecode 0x%04x), inserting silence.\n",
card_index, dropped_frames, timecode);
- vector<float> silence;
- silence.resize(silence_samples * 2);
+ vector<float> silence(silence_samples * 2, 0.0f);
for (int i = 0; i < dropped_frames; ++i) {
card->resampling_queue->add_input_samples(local_pts / double(TIMEBASE), silence.data(), silence_samples);
// Note that if the format changed in the meantime, we have
}
if (audio_level_callback != nullptr) {
+ unique_lock<mutex> lock(r128_mutex);
double loudness_s = r128.loudness_S();
double loudness_i = r128.integrated();
double loudness_range_low = r128.range_min();
vector<float> left, right;
deinterleave_samples(samples_out, &left, &right);
float *ptrs[] = { left.data(), right.data() };
- r128.process(left.size(), ptrs);
+ {
+ unique_lock<mutex> lock(r128_mutex);
+ r128.process(left.size(), ptrs);
+ }
// Send the samples to the sound card.
if (alsa) {