Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package mpvpaper for openSUSE:Factory checked in at 2024-04-25 20:48:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mpvpaper (Old) and /work/SRC/openSUSE:Factory/.mpvpaper.new.1880 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mpvpaper" Thu Apr 25 20:48:04 2024 rev:10 rq:1169925 version:1.5 Changes: -------- --- /work/SRC/openSUSE:Factory/mpvpaper/mpvpaper.changes 2023-11-03 22:21:43.983554722 +0100 +++ /work/SRC/openSUSE:Factory/.mpvpaper.new.1880/mpvpaper.changes 2024-04-25 20:48:11.515898154 +0200 @@ -1,0 +2,12 @@ +Tue Apr 23 19:16:44 UTC 2024 - Michael Vetter <[email protected]> + +- Update to 1.5: + * Allow selecting multiple outputs at once without using "*" + like: "DP-2 HDMI-A-1 DP-1" + * Allow using the mpv option "--playlist" to load media + * Load mpv options with the mpv option "config=yes" + instead of manually loading + * Override user configs with options passed with "--mpv-options/-o" + * Fix vo=libmpv not being set when empty for mpv 0.38 + +------------------------------------------------------------------- Old: ---- 1.4.tar.gz New: ---- 1.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mpvpaper.spec ++++++ --- /var/tmp/diff_new_pack.DJXAlF/_old 2024-04-25 20:48:12.959951179 +0200 +++ /var/tmp/diff_new_pack.DJXAlF/_new 2024-04-25 20:48:12.971951619 +0200 @@ -1,7 +1,7 @@ # # spec file for package mpvpaper # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: mpvpaper -Version: 1.4 +Version: 1.5 Release: 0 Summary: A video wallpaper program for wlroots based wayland compositors License: GPL-3.0-or-later ++++++ 1.4.tar.gz -> 1.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpvpaper-1.4/README.md new/mpvpaper-1.5/README.md --- old/mpvpaper-1.4/README.md 2023-11-02 19:40:09.000000000 +0100 +++ new/mpvpaper-1.5/README.md 2024-04-19 17:24:21.000000000 +0200 @@ -11,14 +11,14 @@ - ninja - meson -- pkg-config +- libmpv ### Clone | Build | Install: ``` # Clone git clone --single-branch https://github.com/GhostNaN/mpvpaper # Build cd mpvpaper -meson build --prefix=/usr/local +meson setup build --prefix=/usr/local ninja -C build # Install ninja -C build install diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpvpaper-1.4/src/holder.c new/mpvpaper-1.5/src/holder.c --- old/mpvpaper-1.4/src/holder.c 2023-11-02 19:40:09.000000000 +0100 +++ new/mpvpaper-1.5/src/holder.c 2024-04-19 17:24:21.000000000 +0200 @@ -331,8 +331,8 @@ } } - // Need at least a display and video - if (optind + 1 >= argc) { + // Need at least a output + if (optind >= argc) { fprintf(stderr, "%s", usage); exit(EXIT_FAILURE); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpvpaper-1.4/src/main.c new/mpvpaper-1.5/src/main.c --- old/mpvpaper-1.4/src/main.c 2023-11-02 19:40:09.000000000 +0100 +++ new/mpvpaper-1.5/src/main.c 2024-04-19 17:24:21.000000000 +0200 @@ -63,7 +63,7 @@ static mpv_render_context *mpv_glcontext; static int wakeup_pipe[2]; static char *video_path; -static char *mpv_options; +static char *mpv_options = ""; static struct { char **pauselist; @@ -411,31 +411,11 @@ } static void set_init_mpv_options(const struct wl_state *state) { - // Enable user control through terminal by default + // Enable user control through terminal by default and configs mpv_set_option_string(mpv, "input-default-bindings", "yes"); mpv_set_option_string(mpv, "input-terminal", "yes"); mpv_set_option_string(mpv, "terminal", "yes"); - - // Load user configs - const char *home_dir = getenv("HOME"); - char *config_path = calloc(strlen(home_dir)+1 + 30, sizeof(char)); - strcpy(config_path, home_dir); - - char loaded_configs[50] = ""; - - strcpy(config_path+strlen(home_dir), "/.config/mpv/mpv.conf"); - if (mpv_load_config_file(mpv, config_path) == 0) - strcat(loaded_configs, "mpv.conf "); - strcpy(config_path+strlen(home_dir), "/.config/mpv/input.conf"); - if (mpv_load_config_file(mpv, config_path) == 0) - strcat(loaded_configs, "input.conf "); - strcpy(config_path+strlen(home_dir), "/.config/mpv/fonts.conf"); - if (mpv_load_config_file(mpv, config_path) == 0) - strcat(loaded_configs, "fonts.conf "); - free(config_path); - - if (VERBOSE && strcmp(loaded_configs, "")) - cflp_info("Loaded [ %s] user configs from \"~/.config/mpv/\"", loaded_configs); + mpv_set_option_string(mpv, "config", "yes"); // Convenience options passed for slideshow mode if (SLIDESHOW_TIME != 0) { @@ -444,7 +424,7 @@ } // Set mpv_options passed - if (mpv_options) { + if (strcmp(mpv_options, "") != 0) { // Create config file name char *opt_config_path = calloc(strlen("/tmp/mpvpaper.config")+1 + strlen(state->monitor)+1, sizeof(char)); strcpy(opt_config_path, "/tmp/mpvpaper"); @@ -491,10 +471,15 @@ exit_mpvpaper(EXIT_FAILURE); } + // Run again after mpv_initialize to override options in config files + set_init_mpv_options(state); + // Force libmpv vo as nothing else will work char *vo_option = mpv_get_property_string(mpv, "options/vo"); - if (strcmp(vo_option, "libmpv") != 0 && strcmp(vo_option, "") != 0) { - cflp_warning("mpvpaper does not support any other vo than \"libmpv\""); + if (strcmp(vo_option, "libmpv") != 0) { + if (strcmp(vo_option, "") != 0) { + cflp_warning("mpvpaper does not support any other vo than \"libmpv\""); + } mpv_set_option_string(mpv, "vo", "libmpv"); } @@ -531,8 +516,20 @@ mpv_command(mpv, (const char*[]) {"set", "playlist-start", playlist_pos, NULL}); } - mpv_command(mpv, (const char*[]) {"loadfile", video_path, NULL}); + // Load media or try loading as playlist file + if (strstr(video_path, "--playlist=") == NULL) { + mpv_err = mpv_command(mpv, (const char*[]) {"loadfile", video_path, NULL}); + } else { + // cut out "--playlist=" then load as a list file + mpv_err = mpv_command(mpv, (const char*[]) {"loadlist", video_path+strlen("--playlist="), NULL}); + } + + if (mpv_err < 0) { + cflp_error("Failed to load file, %s", mpv_error_string(mpv_err)); + exit_mpvpaper(EXIT_FAILURE); + } + // Wait for file to load mpv_event *event = mpv_wait_event(mpv, 1); while (event->event_id != MPV_EVENT_FILE_LOADED) { event = mpv_wait_event(mpv, 1); @@ -611,6 +608,11 @@ cflp_error("Failed to load OpenGL 0x%X", eglGetError()); exit_mpvpaper(EXIT_FAILURE); } + + // After making EGL_NO_SURFACE current to a context + // Only with the Nvidia Pro drivers will set the draw buffer state to GL_NONE + // So we are going to force GL_BACK just like Mesa's EGL implementation + glDrawBuffer(GL_BACK); } static void destroy_display_output(struct display_output *output) { @@ -711,7 +713,7 @@ struct display_output *output = data; - bool name_ok = (strcmp(output->name, output->state->monitor) == 0) || (strcmp(output->state->monitor, "*") == 0); + bool name_ok = (strstr(output->state->monitor, output->name) != NULL) || (strcmp(output->state->monitor, "*") == 0); if (name_ok && !output->layer_surface) { if (VERBOSE) cflp_info("Output %s (%s) selected", output->name, output->identifier); @@ -968,15 +970,35 @@ if (VERBOSE) cflp_info("Verbose Level %i enabled", VERBOSE); - // Need at least a display and video - if (optind + 1 >= argc) { - cflp_error("Not enough args passed"); + // Need at least a output and file or playlist file + char *playlist_opt_pointer; + if((playlist_opt_pointer = strstr(mpv_options, "--playlist=")) != NULL) { + + // cut out mpv "--playlist=/my/list.txt" option from mpv_options as video_path, we will cut out "--playlist=" later + video_path = strtok(strdup(playlist_opt_pointer), "\n"); + + // remove mpv "--playlist=" option from mpv_options to avoid "The playlist option can't be used in a config file." + char *playlist_opt_pointer_tail = playlist_opt_pointer+strlen(video_path); + memmove(playlist_opt_pointer, playlist_opt_pointer_tail, strlen(playlist_opt_pointer_tail)+1); + + if (optind >= argc) { + cflp_error("Not enough args passed\n" + "Please set output"); + fprintf(stderr, "%s", usage); + exit(EXIT_FAILURE); + } + } + else if (optind + 1>= argc) { + cflp_error("Not enough args passed\n" + "Please set output and url|path filename"); fprintf(stderr, "%s", usage); exit(EXIT_FAILURE); } state->monitor = strdup(argv[optind]); - video_path = strdup(argv[optind+1]); + if (!video_path) + video_path = strdup(argv[optind+1]); + } static void check_paper_processes() {
