mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
clapper-app: Support Windows high resolution clock
Windows high resolution clock improves accuracy of various Windows timer APIs and precision of GstSystemClock during playback
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
|
||||
#include "clapper-app-application.h"
|
||||
#include "clapper-app-types.h"
|
||||
#include "clapper-app-utils.h"
|
||||
|
||||
gint
|
||||
main (gint argc, gchar **argv)
|
||||
@@ -34,6 +35,10 @@ main (gint argc, gchar **argv)
|
||||
GApplication *application;
|
||||
gint status;
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
guint resolution = 0;
|
||||
#endif
|
||||
|
||||
g_setenv ("GSK_RENDERER", "gl", FALSE);
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
@@ -48,13 +53,24 @@ main (gint argc, gchar **argv)
|
||||
adw_init ();
|
||||
|
||||
clapper_app_types_init ();
|
||||
clapper_app_utils_debug_init ();
|
||||
|
||||
g_set_application_name ("Clapper");
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
clapper_app_utils_win_enforce_hi_res_clock ();
|
||||
resolution = clapper_app_utils_win_hi_res_clock_start ();
|
||||
#endif
|
||||
|
||||
application = clapper_app_application_new ();
|
||||
|
||||
status = g_application_run (application, argc, argv);
|
||||
g_object_unref (application);
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
if (resolution > 0)
|
||||
clapper_app_utils_win_hi_res_clock_stop (resolution);
|
||||
#endif
|
||||
|
||||
return status;
|
||||
}
|
||||
|
Reference in New Issue
Block a user