CHECK(init_movit(MOVIT_SHADER_DIR, MOVIT_DEBUG_OFF));
check_error();
+ // Since we allow non-bouncing 4:2:2 YCbCrInputs, effective subpixel precision
+ // will be halved when sampling them, and we need to compensate here.
+ movit_texel_subpixel_precision /= 2.0;
+
resource_pool.reset(new ResourcePool);
theme.reset(new Theme("theme.lua", resource_pool.get()));
output_channel[OUTPUT_LIVE].parent = this;
return;
}
- // Convert the audio to stereo fp32 and add it.
- size_t num_samples = (audio_frame.len - audio_offset) / 8 / 3;
- vector<float> audio;
- audio.resize(num_samples * 2);
- convert_fixed24_to_fp32(&audio[0], 2, audio_frame.data + audio_offset, 8, num_samples);
-
int unwrapped_timecode = timecode;
int dropped_frames = 0;
if (card->last_timecode != -1) {
}
card->last_timecode = unwrapped_timecode;
+ // Convert the audio to stereo fp32 and add it.
+ size_t num_samples = (audio_frame.len >= audio_offset) ? (audio_frame.len - audio_offset) / 8 / 3 : 0;
+ vector<float> audio;
+ audio.resize(num_samples * 2);
+ convert_fixed24_to_fp32(&audio[0], 2, audio_frame.data + audio_offset, 8, num_samples);
+
// Add the audio.
{
unique_lock<mutex> lock(card->audio_mutex);