fixed CID 424188, 42421{0,1,2,6}

COPY_INSTEAD_OF_MOVE
This commit is contained in:
Martin Pulec
2023-11-30 12:25:39 +01:00
parent d093dbb0a9
commit 6183399199
5 changed files with 9 additions and 5 deletions

View File

@@ -154,7 +154,7 @@ void state_transcoder_decompress::worker()
if(!frame){
should_exit = true;
} else {
recompress_process_async(recompress, frame);
recompress_process_async(recompress, std::move(frame));
}
// we are removing from queue now because special messages are "accepted" when queue is empty

View File

@@ -170,7 +170,7 @@ static void recompress_port_write(recompress_output_port& port, shared_ptr<video
port.frames = 0;
}
port.video_rxtx->send(frame);
port.video_rxtx->send(std::move(frame));
}
static void recompress_worker(struct recompress_worker_ctx *ctx){

View File

@@ -134,7 +134,8 @@ struct video_frame *video_frame_pool::get_pod_frame() {
for (unsigned int i = 0; i < frame->tile_count; ++i) {
out->tiles[i].data = frame->tiles[i].data;
}
out->callbacks.dispose_udata = new std::shared_ptr<video_frame>(frame);
out->callbacks.dispose_udata =
new std::shared_ptr<video_frame>(std::move(frame));
static auto deleter = [](video_frame *f) { delete static_cast<std::shared_ptr<video_frame> *>(f->callbacks.dispose_udata); };
out->callbacks.data_deleter = deleter;
return out;

View File

@@ -891,7 +891,7 @@ void vidcap_state_aja::CaptureFrames (void)
if (out->color_spec == R12L) {
shared_ptr<video_frame> converted = mPool.get_frame();
vc_copylineR12AtoR12L((unsigned char *) converted->tiles[0].data, (unsigned char *) out->tiles[0].data, out->tiles[0].data_len, 0, 0, 0);
out = converted;
out = std::move(converted);
}
if (log_level >= LOG_LEVEL_DEBUG) {

View File

@@ -828,7 +828,10 @@ void* display_vulkan_init(module* parent, const char* fmt, unsigned int flags) {
}
#endif
s->vulkan = new vkd::VulkanDisplay{};
s->vulkan->init(std::move(instance), vk::SurfaceKHR(surface), initial_frame_count, *s->window_callback, args.gpu_idx, path_to_shaders, args.vsync, args.tearing_permitted);
s->vulkan->init(std::move(instance), vk::SurfaceKHR(surface),
initial_frame_count, *s->window_callback,
args.gpu_idx, std::move(path_to_shaders),
args.vsync, args.tearing_permitted);
LOG(LOG_LEVEL_NOTICE) << MOD_NAME "Vulkan display initialised." << std::endl;
}
catch (std::exception& e) { log_and_exit_uv(e); return nullptr; }