summaryrefslogtreecommitdiffstats
path: root/video/d3d.c
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-10-21 04:55:41 +0200
committerDudemanguy <random342@airmail.cc>2023-11-05 17:36:17 +0000
commit174df99ffa53f1091589eaa4fa0c16cdd55a9326 (patch)
tree3a60d45615f18beed98a9b08267c28ed7e05dd5f /video/d3d.c
parent3a8b107f6216b38a151d5ca1e9d4f2727e3418f5 (diff)
downloadmpv-174df99ffa53f1091589eaa4fa0c16cdd55a9326.tar.bz2
mpv-174df99ffa53f1091589eaa4fa0c16cdd55a9326.tar.xz
ALL: use new mp_thread abstraction
Diffstat (limited to 'video/d3d.c')
-rw-r--r--video/d3d.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/video/d3d.c b/video/d3d.c
index dfb999b854..baa33d2f6f 100644
--- a/video/d3d.c
+++ b/video/d3d.c
@@ -15,8 +15,6 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <pthread.h>
-
#include "config.h"
#include <libavcodec/avcodec.h>
@@ -28,20 +26,21 @@
#include <libavutil/hwcontext_dxva2.h>
#endif
-#include "common/common.h"
#include "common/av_common.h"
+#include "common/common.h"
+#include "osdep/threads.h"
+#include "osdep/windows_utils.h"
#include "video/fmt-conversion.h"
#include "video/hwdec.h"
-#include "video/mp_image.h"
#include "video/mp_image_pool.h"
-#include "osdep/windows_utils.h"
+#include "video/mp_image.h"
#include "d3d.h"
HMODULE d3d11_dll, d3d9_dll, dxva2_dll;
PFN_D3D11_CREATE_DEVICE d3d11_D3D11CreateDevice;
-static pthread_once_t d3d_load_once = PTHREAD_ONCE_INIT;
+static mp_once d3d_load_once = MP_STATIC_ONCE_INITIALIZER;
#if !HAVE_UWP
static void d3d_do_load(void)
@@ -65,7 +64,7 @@ static void d3d_do_load(void)
void d3d_load_dlls(void)
{
- pthread_once(&d3d_load_once, d3d_do_load);
+ mp_exec_once(&d3d_load_once, d3d_do_load);
}
// Test if Direct3D11 can be used by us. Basically, this prevents trying to use