uint16_t video_timecode = pending_video_frames.front().timecode;
uint16_t audio_timecode = pending_audio_frames.front().timecode;
- if (video_timecode < audio_timecode) {
+ if (uint16_less_than_with_wraparound(video_timecode, audio_timecode)) {
printf("Video block 0x%04x without corresponding audio block, dropping.\n",
video_timecode);
video_frame_allocator->release_frame(pending_video_frames.front().frame);
pending_video_frames.pop_front();
- } else if (audio_timecode < video_timecode) {
- printf("Audio block 0x%04x without corresponding video block, dropping.\n",
+ } else if (uint16_less_than_with_wraparound(audio_timecode, video_timecode)) {
+ printf("Audio block 0x%04x without corresponding video block, sending blank frame.\n",
audio_timecode);
- audio_frame_allocator->release_frame(pending_audio_frames.front().frame);
+ QueuedFrame audio_frame = pending_audio_frames.front();
pending_audio_frames.pop_front();
+ lock.unlock();
+ frame_callback(audio_timecode,
+ FrameAllocator::Frame(), 0, 0x0000,
+ audio_frame.frame, AUDIO_HEADER_SIZE, audio_frame.format);
} else {
QueuedFrame video_frame = pending_video_frames.front();
QueuedFrame audio_frame = pending_audio_frames.front();