Skip to content

Commit

Permalink
fixed CID 424188, 42421{0,1,2,6}
Browse files Browse the repository at this point in the history
COPY_INSTEAD_OF_MOVE
  • Loading branch information
MartinPulec committed Nov 30, 2023
1 parent d093dbb commit 6183399
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/hd-rum-translator/hd-rum-decompress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/hd-rum-translator/hd-rum-recompress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
3 changes: 2 additions & 1 deletion src/utils/video_frame_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/video_capture/aja.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion src/video_display/vulkan/vulkan_sdl2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down

0 comments on commit 6183399

Please sign in to comment.