X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=decklink_capture.cpp;h=81566cb1a5ad20d85a3be25a8b01e2c24a62906e;hb=54067dbc70999d936adf9d263b5ff2b1efb4dfd0;hp=a4753cbd767eefc8a480242a64775cedf95c3141;hpb=6ac03a94da0872c424caab1de79a9a0c1822305a;p=nageru diff --git a/decklink_capture.cpp b/decklink_capture.cpp index a4753cb..81566cb 100644 --- a/decklink_capture.cpp +++ b/decklink_capture.cpp @@ -20,6 +20,7 @@ using namespace std; using namespace std::placeholders; +using namespace bmusb; namespace { @@ -58,7 +59,7 @@ size_t memcpy_interleaved_fastpath(uint8_t *dest1, uint8_t *dest2, const uint8_t memcpy_interleaved(dest1, dest2, src, n2); dest1 += n2 / 2; dest2 += n2 / 2; - if (n2 % 1) { + if (n2 % 2) { swap(dest1, dest2); } src = aligned_src; @@ -384,10 +385,12 @@ HRESULT STDMETHODCALLTYPE DeckLinkCapture::VideoInputFrameArrived( void DeckLinkCapture::configure_card() { if (video_frame_allocator == nullptr) { - set_video_frame_allocator(new MallocFrameAllocator(FRAME_SIZE, NUM_QUEUED_VIDEO_FRAMES)); // FIXME: leak. + owned_video_frame_allocator.reset(new MallocFrameAllocator(FRAME_SIZE, NUM_QUEUED_VIDEO_FRAMES)); + set_video_frame_allocator(owned_video_frame_allocator.get()); } if (audio_frame_allocator == nullptr) { - set_audio_frame_allocator(new MallocFrameAllocator(65536, NUM_QUEUED_AUDIO_FRAMES)); // FIXME: leak. + owned_audio_frame_allocator.reset(new MallocFrameAllocator(65536, NUM_QUEUED_AUDIO_FRAMES)); + set_audio_frame_allocator(owned_audio_frame_allocator.get()); } }