X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Fimage_input.cpp;h=4b6840b1327508a2027364fcd196a6924a1a8252;hb=09f6cb41070d746115bbb4ca12325622b564c025;hp=2bf4a237bb86758f92cbdcfba808c514c7c19b82;hpb=392f9d1ccb835c05a3874c4bea163788b2c37024;p=nageru diff --git a/nageru/image_input.cpp b/nageru/image_input.cpp index 2bf4a23..4b6840b 100644 --- a/nageru/image_input.cpp +++ b/nageru/image_input.cpp @@ -30,7 +30,7 @@ extern "C" { #include #include -#include "ffmpeg_raii.h" +#include "shared/ffmpeg_raii.h" #include "ffmpeg_util.h" #include "flags.h" @@ -63,7 +63,7 @@ void ImageInput::set_gl_state(GLuint glsl_program_num, const string& prefix, uns // so there's a fair amount of OpenGL memory waste anyway (the cache // is mostly there to save startup time, not RAM). { - unique_lock lock(all_images_lock); + lock_guard lock(all_images_lock); if (all_images[pathname] != current_image) { current_image = all_images[pathname]; set_pixel_data(current_image->pixels.get()); @@ -74,7 +74,7 @@ void ImageInput::set_gl_state(GLuint glsl_program_num, const string& prefix, uns shared_ptr ImageInput::load_image(const string &filename, const string &pathname) { - unique_lock lock(all_images_lock); // Held also during loading. + lock_guard lock(all_images_lock); // Held also during loading. if (all_images.count(pathname)) { return all_images[pathname]; } @@ -234,7 +234,7 @@ void ImageInput::update_thread_func(const std::string &filename, const std::stri continue; } fprintf(stderr, "Loaded new version of %s from disk.\n", pathname.c_str()); - unique_lock lock(all_images_lock); + lock_guard lock(all_images_lock); all_images[pathname] = image; last_modified = image->last_modified; } @@ -243,7 +243,7 @@ void ImageInput::update_thread_func(const std::string &filename, const std::stri void ImageInput::shutdown_updaters() { { - unique_lock lock(threads_should_quit_mu); + lock_guard lock(threads_should_quit_mu); threads_should_quit = true; threads_should_quit_modified.notify_all(); }