void Mixer::bm_frame(unsigned card_index, uint16_t timecode,
FrameAllocator::Frame video_frame, size_t video_offset, VideoFormat video_format,
- FrameAllocator::Frame audio_frame, size_t audio_offset, uint16_t audio_format)
+ FrameAllocator::Frame audio_frame, size_t audio_offset, AudioFormat audio_format)
{
CaptureCard *card = &cards[card_index];
// Convert the audio to stereo fp32 and add it.
vector<float> audio;
audio.resize(num_samples * 2);
- convert_fixed24_to_fp32(&audio[0], 2, audio_frame.data + audio_offset, 8, num_samples);
+ switch (audio_format.bits_per_sample) {
+ case 24:
+ convert_fixed24_to_fp32(&audio[0], 2, audio_frame.data + audio_offset, audio_format.num_channels, num_samples);
+ break;
+ default:
+ fprintf(stderr, "Cannot handle audio with %u bits per sample\n", audio_format.bits_per_sample);
+ assert(false);
+ }
// Add the audio.
{
clock_gettime(CLOCK_MONOTONIC, &frame_upload_start);
}
userdata->last_interlaced = video_format.interlaced;
+ userdata->last_has_signal = video_format.has_signal;
userdata->last_frame_rate_nom = video_format.frame_rate_nom;
userdata->last_frame_rate_den = video_format.frame_rate_den;
RefCountedFrame new_frame(video_frame);