]> uap-core.de Git - uwplayer.git/commitdiff
use mpv binary path from settings
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Sat, 15 Jan 2022 12:46:25 +0000 (13:46 +0100)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Sat, 15 Jan 2022 12:46:25 +0000 (13:46 +0100)
application/Makefile
application/player.c
application/settings.c
application/settings.h

index ea2143940db390998c3580a8b112e60176018a72..8b530924e71a84c5bf45845acde3eebfd8faacf2 100644 (file)
@@ -41,7 +41,7 @@ SRC += json.c
 
 OBJ = $(SRC:%.c=$(BUILD_ROOT)/build/application/%.$(OBJ_EXT))
 
-BINTARGET = mediaplayer
+BINTARGET = uwplayer
 
 all: $(BUILD_ROOT)/build/bin/$(BINTARGET)
 
index 9e470497bede5be35d55ceb47586cff241a2ce52..9e65410af25b16414869858b78a773aac2745eae 100644 (file)
@@ -39,6 +39,7 @@
 #include <pthread.h>
 
 #include "json.h"
+#include "settings.h"
 
 extern char **environ;
 
@@ -121,7 +122,11 @@ static int start_player_process(Player *player, MainWindow *win) {
         return 1;
     }
     
-    char *player_bin = "/usr/local/bin/mpv"; // TODO: get bin from settings
+    char *player_bin = SettingsGetPlayerBin();
+    if(!player_bin) {
+        fprintf(stderr, "No mpv binary available\n");
+        return 1;
+    }
     
     // -wid parameter value for embedding the player in the player_widget
     Window wid = XtWindow(win->player_widget);
index ceff1c76ad000403978ba28e7f2b25ede0b83907..59c366c08c16d68130222fd035c220c130d59648 100644 (file)
@@ -174,3 +174,7 @@ static void* player_bin_search_thread(void *data) {
     ucx_buffer_free(buf);
     return NULL;
 }
+
+char* SettingsGetPlayerBin(void) {
+    return ucx_map_cstr_get(uwp_settings, UWP_PLAYER_BIN);
+}
index 57be624d1a24bfe98b210041e0b0ee3007f9349c..aabd835ee2fd81b23d5af8c8db7d6dc08dcb86c0 100644 (file)
@@ -37,6 +37,8 @@ typedef struct PlayerInfo {
 
 int load_settings(void);
 
+char* SettingsGetPlayerBin(void);
+
 
 #ifdef __cplusplus
 }