Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package mpvpaper for openSUSE:Factory 
checked in at 2022-02-25 21:25:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mpvpaper (Old)
 and      /work/SRC/openSUSE:Factory/.mpvpaper.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mpvpaper"

Fri Feb 25 21:25:23 2022 rev:7 rq:957646 version:1.2.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/mpvpaper/mpvpaper.changes        2022-02-24 
18:24:37.270640234 +0100
+++ /work/SRC/openSUSE:Factory/.mpvpaper.new.1958/mpvpaper.changes      
2022-02-25 21:26:01.979648602 +0100
@@ -1,0 +2,12 @@
+Fri Feb 25 18:27:01 UTC 2022 - Michael Vetter <[email protected]>
+
+- Update to 1.2.1:
+  * Deprecated MPV_EVENT_PAUSE, MPV_EVENT_UNPAUSE, MPV_EVENT_IDLE
+    replaced #19
+  * mpv's "idle" option is now always off/no.
+    Too many issues, this should help some that have been crashing
+    lately
+  * More various fixes outlined here: 50c0c8d
+- Remove Fixed-mpv-events-cleanup-and-more.patch: upstreamed
+
+-------------------------------------------------------------------

Old:
----
  1.2.tar.gz
  Fixed-mpv-events-cleanup-and-more.patch

New:
----
  1.2.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ mpvpaper.spec ++++++
--- /var/tmp/diff_new_pack.SYMgs4/_old  2022-02-25 21:26:02.495648694 +0100
+++ /var/tmp/diff_new_pack.SYMgs4/_new  2022-02-25 21:26:02.499648695 +0100
@@ -17,15 +17,13 @@
 
 
 Name:           mpvpaper
-Version:        1.2
+Version:        1.2.1
 Release:        0
 Summary:        A video wallpaper program for wlroots based wayland compositors
 License:        GPL-3.0-or-later
 Group:          Productivity/Multimedia/Other
 URL:            https://github.com/GhostNaN/mpvpaper
 Source:         https://github.com/GhostNaN/mpvpaper/archive/%{version}.tar.gz
-# PATCH-FIX-UPSTREAM Fix build with removed deprecated APIs in mpv 2.x 
https://github.com/GhostNaN/mpvpaper/commit/50c0c8def6d96bb2f992fad6c77b86fa85e1a596
-Patch0:         Fixed-mpv-events-cleanup-and-more.patch
 BuildRequires:  meson
 BuildRequires:  mpv-devel
 BuildRequires:  ninja

++++++ 1.2.tar.gz -> 1.2.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpvpaper-1.2/mpvpaper.man 
new/mpvpaper-1.2.1/mpvpaper.man
--- old/mpvpaper-1.2/mpvpaper.man       2021-11-15 16:30:05.000000000 +0100
+++ new/mpvpaper-1.2.1/mpvpaper.man     2022-02-24 06:04:43.000000000 +0100
@@ -1,4 +1,4 @@
-.TH MPVPAPER 1 "November 2021" "mpvpaper 1.2" "User Manual"
+.TH MPVPAPER 1 "February 2022" "mpvpaper 1.2.1" "User Manual"
 .SH NAME
 mpvpaper \- video wallpaper player using mpv for wlroots
 .SH SYNOPSIS
@@ -150,5 +150,3 @@
 .SH SEE ALSO
 
 mpv (1)
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpvpaper-1.2/src/main.c new/mpvpaper-1.2.1/src/main.c
--- old/mpvpaper-1.2/src/main.c 2021-11-15 16:30:05.000000000 +0100
+++ new/mpvpaper-1.2.1/src/main.c       2022-02-24 06:04:43.000000000 +0100
@@ -76,7 +76,7 @@
 
 } halt_info = {NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0};
 
-static pthread_t threads[5];
+static pthread_t threads[5] = {0};
 
 static uint SLIDESHOW_TIME = 0;
 static bool VERBOSE = 0;
@@ -90,12 +90,6 @@
             pthread_cancel(threads[i]);
     }
 
-    // Give mpv a chance to finish
-    halt_info.kill_render_loop = 1;
-    for (int trys=10; halt_info.kill_render_loop && trys > 0; trys--) {
-        usleep(10000);
-    }
-
     if (mpv_glcontext)
        mpv_render_context_free(mpv_glcontext);
     if (mpv)
@@ -162,6 +156,10 @@
         while (halt_info.is_paused) {
             if (time(NULL) - start_time >= 1)
                 break;
+            if (halt_info.kill_render_loop) {
+                halt_info.kill_render_loop = 0;
+                exit_mpvpaper(0);
+            }
             usleep(1000);
         }
     }
@@ -169,8 +167,10 @@
     // Render next frame
     if (!halt_info.kill_render_loop)
         render(data);
-    else
+    else {
         halt_info.kill_render_loop = 0;
+        exit_mpvpaper(0);
+    }
 }
 
 const static struct wl_callback_listener wl_surface_frame_listener = {
@@ -266,7 +266,8 @@
             }
             if (is_paused) {
                 is_paused = 0;
-                halt_info.is_paused -= 1;
+                if (halt_info.is_paused)
+                    halt_info.is_paused -= 1;
             }
         }
         pthread_sleep(1);
@@ -311,7 +312,8 @@
             }
             if (is_paused) {
                 is_paused = 0;
-                halt_info.is_paused -= 1;
+                if (halt_info.is_paused)
+                    halt_info.is_paused -= 1;
             }
         }
         pthread_sleep(1);
@@ -346,6 +348,9 @@
     bool mpv_paused = 0;
     time_t start_time = time(NULL);
 
+    const int MPV_OBSERVE_PAUSE = 1;
+    mpv_observe_property(mpv, MPV_OBSERVE_PAUSE, "pause", MPV_FORMAT_FLAG);
+
     while (!halt_info.kill_render_loop) {
         if (SLIDESHOW_TIME) {
             if ((time(NULL) - start_time) >= SLIDESHOW_TIME) {
@@ -355,17 +360,33 @@
         }
 
         mpv_event* event = mpv_wait_event(mpv, 0);
-        if (event->event_id == MPV_EVENT_SHUTDOWN || event->event_id == 
MPV_EVENT_IDLE)
-            exit_mpvpaper(0);
-        else if (event->event_id == MPV_EVENT_PAUSE) {
-            mpv_paused = 1;
-            // User paused
-            if (!halt_info.is_paused)
-                halt_info.is_paused += 1;
-        }
-        else if (event->event_id == MPV_EVENT_UNPAUSE) {
-            mpv_paused = 0;
-            halt_info.is_paused = 0;
+
+        if (event->event_id == MPV_EVENT_SHUTDOWN) {
+            // Give mpv a chance to finish
+            halt_info.kill_render_loop = 1;
+            for (int trys=10; halt_info.kill_render_loop && trys > 0; trys--) {
+                usleep(10000);
+            }
+
+            // render loop didn't kill itself, this may cause crashing
+            if (halt_info.kill_render_loop) {
+                if (VERBOSE)
+                    cflp_warning("Failed to quit mpv");
+                exit_mpvpaper(0);
+            }
+            break;
+        }
+        else if (event->event_id == MPV_EVENT_PROPERTY_CHANGE) {
+            if (event->reply_userdata == MPV_OBSERVE_PAUSE) {
+                mpv_get_property(mpv, "pause", MPV_FORMAT_FLAG, &mpv_paused);
+                if (mpv_paused) {
+                    // User paused
+                    if (!halt_info.is_paused)
+                        halt_info.is_paused += 1;
+                } else {
+                    halt_info.is_paused = 0;
+                }
+            }
         }
 
         if (!halt_info.is_paused && mpv_paused) {
@@ -374,6 +395,9 @@
 
         pthread_usleep(10000);
     }
+
+    mpv_unobserve_property(mpv, MPV_OBSERVE_PAUSE);
+
     pthread_exit(NULL);
 }
 
@@ -458,8 +482,9 @@
 
     set_init_mpv_options();
 
-    if (mpv_initialize(mpv) < 0) {
-        cflp_error("mpv init failed");
+    int err = mpv_initialize(mpv);
+    if (err < 0) {
+        cflp_error("Failed to init mpv, %s", mpv_error_string(err));
         exit_mpvpaper(1);
     }
 
@@ -491,12 +516,12 @@
         // Save default start pos
         default_start = mpv_get_property_string(mpv, "start");
         // Restore video position
-        mpv_command_async(mpv, 0, (const char*[]) {"set", "start", time_pos, 
NULL});
+        mpv_command(mpv, (const char*[]) {"set", "start", time_pos, NULL});
         // Recover playlist pos, that is if it's not shuffled...
-        mpv_command_async(mpv, 0, (const char*[]) {"set", "playlist-start", 
playlist_pos, NULL});
+        mpv_command(mpv, (const char*[]) {"set", "playlist-start", 
playlist_pos, NULL});
     }
 
-    mpv_command_async(mpv, 0, (const char*[]) {"loadfile", video_path, NULL});
+    mpv_command(mpv, (const char*[]) {"loadfile", video_path, NULL});
 
     mpv_event* event = mpv_wait_event(mpv, 1);
     while (event->event_id != MPV_EVENT_FILE_LOADED){
@@ -507,7 +532,10 @@
 
     // Return start pos to default
     if (default_start)
-        mpv_command_async(mpv, 0, (const char*[]) {"set", "start", 
default_start, NULL});
+        mpv_command(mpv, (const char*[]) {"set", "start", default_start, 
NULL});
+
+    // mpv must never idle
+    mpv_command(mpv, (const char*[]) {"set", "idle", "no", NULL});
 }
 
 static void init_egl(struct display_output *output) {
@@ -548,7 +576,7 @@
             egl_context = eglCreateContext(egl_display, config, 
EGL_NO_CONTEXT, ctx_attrib);
             if (egl_context) {
                 if (VERBOSE) {
-                    cflp_info("OpenGL %i.%i EGL context loaded", 
gl_versions[i].major, gl_versions[i].minor);
+                    cflp_info("OpenGL %i.%i EGL context created", 
gl_versions[i].major, gl_versions[i].minor);
                 }
                 break;
             }
@@ -563,7 +591,10 @@
     eglMakeCurrent(egl_display, egl_surface, egl_surface, egl_context);
     eglSwapInterval(egl_display, 0);
 
-    gladLoadGLLoader((GLADloadproc) eglGetProcAddress);
+    if(!gladLoadGLLoader((GLADloadproc) eglGetProcAddress)) {
+        cflp_error("Failed to load OpenGL");
+        exit_mpvpaper(1);
+    }
 
     glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
     glViewport(0, 0, output->width, output->height);
@@ -767,7 +798,9 @@
         }
 
         fclose(file);
-        return list;
+        // If any app found
+        if (list[0])
+            return list;
     }
     return NULL;
 }
@@ -923,6 +956,8 @@
 
 int main(int argc, char **argv) {
     signal(SIGINT, handle_signal);
+    signal(SIGQUIT, handle_signal);
+    signal(SIGTERM, handle_signal);
 
     struct wl_state state = {0};
     wl_list_init(&state.outputs);

Reply via email to