From: Steinar H. Gunderson Date: Tue, 13 Oct 2015 20:49:41 +0000 (+0200) Subject: If we have an audio block with no video, send it on anyway (since audio continuity... X-Git-Tag: 0.4~52 X-Git-Url: https://git.sesse.net/?p=bmusb;a=commitdiff_plain;h=1353b0ec496ff464be4990ee1d671e4fa376b874 If we have an audio block with no video, send it on anyway (since audio continuity is important). --- diff --git a/bmusb.cpp b/bmusb.cpp index fbf31dd..8b40f49 100644 --- a/bmusb.cpp +++ b/bmusb.cpp @@ -164,10 +164,14 @@ void BMUSBCapture::dequeue_thread_func() 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", + 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();