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

Building fails with newer versions of mpv: api change in mpv >= 0.34 #217

Open
Kieltux opened this issue Jan 21, 2022 · 4 comments
Open

Comments

@Kieltux
Copy link

Kieltux commented Jan 21, 2022

Hello Flavio,
I am the maintainer of your great and useful application minitube in openSUSE.
openSUSE Factory and Tumbleweed switched to libmpv2-0.34.1+git.20220117T134844.22b and now building fails.

https://build.opensuse.org/package/live_build_log/openSUSE:Factory/minitube/standard/x86_64

[   97s] lib/media/src/mpv/mpvwidget.cpp: In member function 'virtual void MpvWidget::initializeGL()':
[   97s] lib/media/src/mpv/mpvwidget.cpp:33:74: error: too many initializers for 'mpv_opengl_init_params'
[   97s]    33 |     mpv_opengl_init_params gl_init_params{get_proc_address, this, nullptr};
[   97s]       |                                                                          ^
[   97s] make: *** [Makefile:2550: build/obj/lib/media/src/mpv/mpvwidget.o] Error 1

There seems to be an api change in mpv >= 0.34, because I also found this issue in another project based on mpv:
mpc-qt/mpc-qt#17

I could fix building minitube with this patch (based on mpc-qt/mpc-qt@a880cb8)

diff -Nur minitube-3.9.2/lib/media/src/mpv/mpvwidget.cpp new/lib/media/src/mpv/mpvwidget.cpp
--- minitube-3.9.2/lib/media/src/mpv/mpvwidget.cpp	2021-11-11 13:11:41.000000000 +0100
+++ new/lib/media/src/mpv/mpvwidget.cpp	2022-01-21 18:07:34.170765429 +0100
@@ -30,7 +30,11 @@
     qDebug() << "initializeGL" << nativeParent;
     if (nativeParent == nullptr) qFatal("No native parent");
 
-    mpv_opengl_init_params gl_init_params{get_proc_address, this, nullptr};
+    #if MPV_CLIENT_API_VERSION < MPV_MAKE_VERSION(2,0)
+	mpv_opengl_init_params gl_init_params{get_proc_address, this, nullptr};
+    #else
+	mpv_opengl_init_params gl_init_params{get_proc_address, this};
+    #endif
     mpv_render_param params[]{{MPV_RENDER_PARAM_API_TYPE, (void *)MPV_RENDER_API_TYPE_OPENGL},
                               {MPV_RENDER_PARAM_OPENGL_INIT_PARAMS, &gl_init_params},
                               {MPV_RENDER_PARAM_INVALID, nullptr},

As I am not an experienced git user, I attached the patch.

Best wishes.
minitube-fix-mpv-api-change.zip

@flaviotordini
Copy link
Owner

flaviotordini commented Jan 22, 2022 via email

@dvzrv
Copy link
Contributor

dvzrv commented Nov 13, 2022

@flaviotordini mpv 0.35 has now been released and the build fails.
Can you please integrate this and create a new release? That would be very helpful for downstream packagers! :)

archlinux-github pushed a commit to archlinux/svntogit-community that referenced this issue Nov 13, 2022
Add upstreamed patch for compatibility with mpv 0.35: flaviotordini/minitube#217
Remove unnecessary quotes and curly braces.

git-svn-id: file:///srv/repos/svn-community/svn@1347251 9fca08f4-af9d-4005-b8df-a31f2cc04f65
archlinux-github pushed a commit to archlinux/svntogit-community that referenced this issue Nov 13, 2022
Add upstreamed patch for compatibility with mpv 0.35: flaviotordini/minitube#217
Remove unnecessary quotes and curly braces.

git-svn-id: file:///srv/repos/svn-community/svn@1347251 9fca08f4-af9d-4005-b8df-a31f2cc04f65
@VVD
Copy link

VVD commented Nov 14, 2022

@Vistaus
Copy link

Vistaus commented Nov 25, 2023

Already fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants