X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=bmusb.cpp;h=85b92a6186c2e90debb70b4cc3fa85a0598d5eb7;hb=30a75fd8110601c89ecc7c1a0832a96878917cd4;hp=4db8541eb1286e8578f778bad53656181ed8c326;hpb=b3aaee8df3039891d79f4f673e6a8050d3fb65b5;p=bmusb diff --git a/bmusb.cpp b/bmusb.cpp index 4db8541..85b92a6 100644 --- a/bmusb.cpp +++ b/bmusb.cpp @@ -191,6 +191,9 @@ void BMUSBCapture::dequeue_thread_func() uint16_t video_timecode = pending_video_frames.front().timecode; uint16_t audio_timecode = pending_audio_frames.front().timecode; + AudioFormat audio_format; + audio_format.bits_per_sample = 24; + audio_format.num_channels = 8; if (uint16_less_than_with_wraparound(video_timecode, audio_timecode)) { printf("Video block 0x%04x without corresponding audio block, dropping.\n", video_timecode); @@ -204,9 +207,10 @@ void BMUSBCapture::dequeue_thread_func() QueuedFrame audio_frame = pending_audio_frames.front(); pending_audio_frames.pop_front(); lock.unlock(); + audio_format.id = audio_frame.format; frame_callback(audio_timecode, FrameAllocator::Frame(), 0, VideoFormat(), - audio_frame.frame, AUDIO_HEADER_SIZE, audio_frame.format); + audio_frame.frame, AUDIO_HEADER_SIZE, audio_format); } else { QueuedFrame video_frame = pending_video_frames.front(); QueuedFrame audio_frame = pending_audio_frames.front(); @@ -222,14 +226,15 @@ void BMUSBCapture::dequeue_thread_func() #endif VideoFormat video_format; + audio_format.id = audio_frame.format; if (decode_video_format(video_frame.format, &video_format)) { frame_callback(video_timecode, video_frame.frame, HEADER_SIZE, video_format, - audio_frame.frame, AUDIO_HEADER_SIZE, audio_frame.format); + audio_frame.frame, AUDIO_HEADER_SIZE, audio_format); } else { frame_callback(video_timecode, FrameAllocator::Frame(), 0, video_format, - audio_frame.frame, AUDIO_HEADER_SIZE, audio_frame.format); + audio_frame.frame, AUDIO_HEADER_SIZE, audio_format); } } }