uint16_t timecode = (start[1] << 8) | start[0];
if (current_video_frame.len > 0) {
+ // If format is 0x0800 (no signal), add a fake (empty) audio
+ // frame to get it out of the queue.
+ // TODO: Figure out if there are other formats that come with
+ // no audio, and treat them the same.
+ if (format == 0x0800) {
+ FrameAllocator::Frame fake_audio_frame = audio_frame_allocator->alloc_frame();
+ if (fake_audio_frame.data == nullptr) {
+ // Oh well, it's just a no-signal frame anyway.
+ printf("Couldn't allocate fake audio frame, also dropping no-signal video frame.\n");
+ current_video_frame.owner->release_frame(current_video_frame);
+ current_video_frame = video_frame_allocator->alloc_frame();
+ return;
+ }
+ queue_frame(format, timecode, fake_audio_frame, &pending_audio_frames);
+ }
//dump_frame();
queue_frame(format, timecode, current_video_frame, &pending_video_frames);
}