X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=bmusb.cpp;h=3aac81e5e34e5de7459585630635eab8a460d25a;hb=653fb04b1f7fd18a3361524aeb4877efca032cdb;hp=892802f1c5cf90c5165b37c8a93df28869c33455;hpb=3947e570dc2ab15f4993d0fa4cfd44d8070f0107;p=bmusb diff --git a/bmusb.cpp b/bmusb.cpp index 892802f..3aac81e 100644 --- a/bmusb.cpp +++ b/bmusb.cpp @@ -782,10 +782,12 @@ libusb_device_handle *open_card(int card_index, string *description) void BMUSBCapture::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()); } dequeue_thread_should_quit = false; dequeue_thread = thread(&BMUSBCapture::dequeue_thread_func, this); @@ -1021,7 +1023,7 @@ void BMUSBCapture::configure_card() xfr->user_data = this; //libusb_submit_transfer(xfr); - audiofp = fopen("audio.raw", "wb"); + //audiofp = fopen("audio.raw", "wb"); // set up isochronous transfers for audio and video for (int e = 3; e <= 4; ++e) {