#include <utility>
#include <vector>
-#include "ffmpeg_raii.h"
+#include "shared/ffmpeg_raii.h"
#include "ffmpeg_util.h"
#include "flags.h"
{
if (current_image == nullptr) { // Could happen even though search_for_file() returned.
fprintf(stderr, "Couldn't load image, exiting.\n");
- exit(1);
+ abort();
}
set_width(current_image->width);
set_height(current_image->height);
// so there's a fair amount of OpenGL memory waste anyway (the cache
// is mostly there to save startup time, not RAM).
{
- unique_lock<mutex> lock(all_images_lock);
+ lock_guard<mutex> lock(all_images_lock);
if (all_images[pathname] != current_image) {
current_image = all_images[pathname];
set_pixel_data(current_image->pixels.get());
shared_ptr<const ImageInput::Image> ImageInput::load_image(const string &filename, const string &pathname)
{
- unique_lock<mutex> lock(all_images_lock); // Held also during loading.
+ lock_guard<mutex> lock(all_images_lock); // Held also during loading.
if (all_images.count(pathname)) {
return all_images[pathname];
}
continue;
}
fprintf(stderr, "Loaded new version of %s from disk.\n", pathname.c_str());
- unique_lock<mutex> lock(all_images_lock);
+ lock_guard<mutex> lock(all_images_lock);
all_images[pathname] = image;
last_modified = image->last_modified;
}
void ImageInput::shutdown_updaters()
{
{
- unique_lock<mutex> lock(threads_should_quit_mu);
+ lock_guard<mutex> lock(threads_should_quit_mu);
threads_should_quit = true;
threads_should_quit_modified.notify_all();
}