Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix win32 build error with MPV_BUNDLE #319

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions wiliwili/include/view/mpv_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ typedef int (*mpvRenderContextRenderFunc)(mpv_render_context *ctx, mpv_render_pa
typedef void (*mpvRenderContextReportSwapFunc)(mpv_render_context *ctx);
typedef uint64_t (*mpvRenderContextUpdateFunc)(mpv_render_context *ctx);
typedef void (*mpvRenderContextFreeFunc)(mpv_render_context *ctx);
typedef unsigned long (*mpvClientApiVersionFunc)();

extern mpvSetOptionStringFunc mpvSetOptionString;
extern mpvObservePropertyFunc mpvObserveProperty;
Expand All @@ -102,6 +103,7 @@ extern mpvRenderContextRenderFunc mpvRenderContextRender;
extern mpvRenderContextReportSwapFunc mpvRenderContextReportSwap;
extern mpvRenderContextUpdateFunc mpvRenderContextUpdate;
extern mpvRenderContextFreeFunc mpvRenderContextFree;
extern mpvClientApiVersionFunc mpvClientApiVersion;
#else
#define mpvSetOptionString mpv_set_option_string
#define mpvObserveProperty mpv_observe_property
Expand All @@ -124,6 +126,7 @@ extern mpvRenderContextFreeFunc mpvRenderContextFree;
#define mpvRenderContextReportSwap mpv_render_context_report_swap
#define mpvRenderContextUpdate mpv_render_context_update
#define mpvRenderContextFree mpv_render_context_free
#define mpvClientApiVersion mpv_client_api_version
#endif

class MPVCore : public brls::Singleton<MPVCore> {
Expand Down
4 changes: 3 additions & 1 deletion wiliwili/source/view/mpv_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ mpvRenderContextRenderFunc mpvRenderContextRender;
mpvRenderContextReportSwapFunc mpvRenderContextReportSwap;
mpvRenderContextUpdateFunc mpvRenderContextUpdate;
mpvRenderContextFreeFunc mpvRenderContextFree;
mpvClientApiVersionFunc mpvClientApiVersion;
#endif

#ifdef MPV_USE_FB
Expand Down Expand Up @@ -240,6 +241,7 @@ void initMpvProc(Module dll, fnGetProcAddress pGetProcAddress)
mpvRenderContextRender = (mpvRenderContextRenderFunc)pGetProcAddress(dll, "mpv_render_context_render");
mpvRenderContextSetUpdateCallback = (mpvRenderContextSetUpdateCallbackFunc)pGetProcAddress(dll, "mpv_render_context_set_update_callback");
mpvRenderContextReportSwap = (mpvRenderContextReportSwapFunc)pGetProcAddress(dll, "mpv_render_context_report_swap");
mpvClientApiVersion = (mpvClientApiVersionFunc)pGetProcAddress(dll, "mpv_client_api_version");
}
#endif

Expand Down Expand Up @@ -1058,7 +1060,7 @@ void MPVCore::setUrl(const std::string &url, const std::string &extra, const std
if (extra.empty()) {
command_async("loadfile", url, method);
} else {
if (mpv_client_api_version() >= MPV_MAKE_VERSION(2, 3))
if (mpvClientApiVersion() >= MPV_MAKE_VERSION(2, 3))
command_async("loadfile", url, method, "0", extra);
else
command_async("loadfile", url, method, extra);
Expand Down