From e2d342818a33038a8745ce7a4635759b8482d6d4 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 28 Nov 2020 23:33:01 +0100 Subject: [PATCH] filter/color-grade: Fix unicode support Related: #359 --- source/filters/filter-color-grade.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/source/filters/filter-color-grade.cpp b/source/filters/filter-color-grade.cpp index b653b30..010e223 100644 --- a/source/filters/filter-color-grade.cpp +++ b/source/filters/filter-color-grade.cpp @@ -81,18 +81,12 @@ color_grade_instance::~color_grade_instance() {} color_grade_instance::color_grade_instance(obs_data_t* data, obs_source_t* self) : obs::source_instance(data, self) { { - char* file = obs_module_file("effects/color-grade.effect"); - if (file) { - try { - _effect = gs::effect::create(file); - bfree(file); - } catch (std::runtime_error& ex) { - DLOG_ERROR(" Loading _effect '%s' failed with error(s): %s", file, ex.what()); - bfree(file); - throw ex; - } - } else { - throw std::runtime_error("Missing file color-grade.effect."); + auto file = streamfx::data_file_path("effects/color-grade.effect").u8string(); + try { + _effect = gs::effect::create(file); + } catch (std::runtime_error& ex) { + DLOG_ERROR(" Loading effect '%s' failed with error(s): %s", file.c_str(), ex.what()); + throw; } } {