Comments (6)
First off, calling these attach functions is required if pthread-w32 is used when doing static linking. Though it looks like a newer version might make that optional. The latest release seems to have a bug associated with that, but the CVS version might be fine.
The configure test should catch this. It tries to compile a test program using these attach functions, and if that fails, use of pthreads is disabled. Also, pthread.h should always define this, as long as _POSIX_C_SOURCE is defined to something recent (I didn't check if that's still the case with newer pthread-w32 versions). On my Linux system, it's automatically defined to 200809 by the compiler (because we use --std=gnu99). So I'm not sure what's going wrong here, and why the configure test even succeeds. Can you post your config.log?
from mpv.
Also, has this been always the case, or is it a regression?
from mpv.
I'm not sure if it's a regression. I've experienced it since I first attempted to cross-compile mpv, but considering that I only found out about mpv ~3 weeks ago I can't really say if it used to work. I'd never managed to compile MPlayer2 under MinGW due to a lot more build errors, but I'd only realized very very shortly before finding mpv that I was still attempting to build a revision from June. Since mpv was up-to-date and built easily with MinGW, I never attempted another MinGW build of MPlayer2.
I wouldn't be surprised if it's something I did wrong during pthreads' setup, or if the build is a tad too old (I usually only build it after I do a fresh OS upgrade, so the build is from October 25th).
from a fresh clone of mpv-player/mpv.git
during configure:
Checking for pthread ... ./configure: 1498: test: -lpthreadGC2: unexpected operator yes
CC core/m_struct.o CC core/mp_common.o CC core/mp_fifo.o CC core/mp_msg.o CC core/mplayer.o core/mplayer.c: In function 'detach_ptw32': core/mplayer.c:4308:5: error: implicit declaration of function 'pthread_win32_thread_detach_np' [-Werror=implicit-function-declaration] core/mplayer.c:4309:5: error: implicit declaration of function 'pthread_win32_process_detach_np' [-Werror=implicit-function-declaration] core/mplayer.c: In function 'osdep_preinit': core/mplayer.c:4329:5: error: implicit declaration of function 'pthread_win32_process_attach_np' [-Werror=implicit-function-declaration] core/mplayer.c:4330:5: error: implicit declaration of function 'pthread_win32_thread_attach_np' [-Werror=implicit-function-declaration] cc1: some warnings being treated as errors make: *** [core/mplayer.o] Error 1
config.log:
http://pastebin.com/a6c9Nfvg
from mpv.
I was quite puzzled at first, but then I found mplayer.c doesn't even #include the pthread header. Can you try this patch:
diff --git a/configure b/configure index d314141..5d2b23b 100755 --- a/configure +++ b/configure @@ -1495,7 +1495,7 @@ cc_check $_ld_tmp -DPTW32_STATIC_LIB && (tmp_run || test "$_ld_static") && _ld_p fi fi if test "$_pthreads" = yes ; then - test $_ld_pthread && res_comment="using $_ld_pthread" + test "$_ld_pthread" && res_comment="using $_ld_pthread" def_pthreads='#define HAVE_PTHREADS 1' def_threads='#define HAVE_THREADS 1' extra_cflags="$extra_cflags $THREAD_CFLAGS" diff --git a/core/mplayer.c b/core/mplayer.c index 04ea0e2..2d58689 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -22,6 +22,10 @@ #include #include +#ifdef PTW32_STATIC_LIB +#include +#endif + #include #include
from mpv.
The patch as posted fails to patch to core/mplayer.c because the #includes are bare. But I applied it manually and pointed it at pthread.h, and compilation now succeeds.
The binary is also larger, so it does appear that libpthreadGC2 did get linked in.
from mpv.
Oh, sorry, github messes it up when displaying it on the website. Yes, it's meant to "#include <pthread.h>".
Thanks for testing. I'll push the patch to master at some later time.
from mpv.
Related Issues (20)
- [Bug] Randomly the maximum volume from MPV becomes much lower than normal HOT 6
- Keyboard layouts HOT 2
- Full screen exit and dragging weird behavior
- VP9 version hdr10+ video not decoding by mpv and ffprobe giving errors HOT 6
- demux_max: support ITU T.35 metadata, dvcC and dvvC
- VP9 version hdr10+ video not decoding by mpv and ffprobe giving errors HOT 2
- `895f40e1` breaks `hidpi-window-scale` on wayland HOT 4
- Best way to determinate color / format of a video using libmpv
- Incorrect subtitle rendering after jumping when playing with an external PGS subtitle HOT 1
- Libmpv doesn't use libmpv video output as default HOT 3
- Dav1d decoder is not the preferred decoder for AV1 files since mpv 0.38.0 HOT 5
- Dynamic Range and Refresh Rate Matching HOT 1
- Flashing purple screen when using gpu-api=vulkan HOT 1
- AV1 film grain with gpu-next causes SIGABRT HOT 5
- mpv crash on arch linux with vulkan HOT 10
- Can unmaximized window size settings be supported? HOT 5
- mpv use a deprecated mkv balise for lang HOT 1
- Conditional profiles will not work with d3d11va set.
- Shaders not working
- QOpenGLWidget is displayed in its own window since libmpv.so.2.3.0 HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mpv.