[vlc-commits] [Git][videolan/vlc][master] 2 commits: doc: thumbnailer: remove _POSIX_CLOCK_SELECTION

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Feb 9 16:11:31 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
935e17d3 by Alexandre Janniaux at 2024-02-09T15:49:38+00:00
doc: thumbnailer: remove _POSIX_CLOCK_SELECTION

Since e56d9673346fc5ae325bfdc7b665817e655eadf5, there is no
clock_gettime() call amd there is no need for this POSIX feature to be
enabled.

Refs #28519

- - - - -
f030c944 by Alexandre Janniaux at 2024-02-09T15:49:38+00:00
doc: thumbnailer: rename wait condition variable

wait is a standard symbol from POSIX and using the same identifier is
conflicting on macosx, resulting in build errors:

    vlc/doc/libvlc/thumbnailer.c:110:24: error: redefinition of 'wait' as different kind of symbol
    static pthread_cond_t  wait;
                           ^
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h:248:9: note: previous definition is here
    pid_t   wait(int *) __DARWIN_ALIAS_C(wait);
            ^

Fixes #28519

- - - - -


1 changed file:

- doc/libvlc/thumbnailer.c


Changes:

=====================================
doc/libvlc/thumbnailer.c
=====================================
@@ -28,13 +28,6 @@
 #include <pthread.h>
 #include <errno.h>
 #include <time.h>
-
-#if !defined (_POSIX_CLOCK_SELECTION)
-#  define _POSIX_CLOCK_SELECTION (-1)
-#endif
-
-static_assert (_POSIX_CLOCK_SELECTION >= 0, "Clock selection unavailable!");
-
 #include <vlc/vlc.h>
 
 /* position at which the snapshot is taken */
@@ -107,7 +100,7 @@ static libvlc_instance_t *create_libvlc(void)
 }
 
 static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t  wait;
+static pthread_cond_t  wait_callback;
 static bool done;
 
 static void callback(const libvlc_event_t *ev, void *param)
@@ -120,7 +113,7 @@ static void callback(const libvlc_event_t *ev, void *param)
         if (*pic != NULL)
             libvlc_picture_retain(*pic);
         done = true;
-        pthread_cond_signal(&wait);
+        pthread_cond_signal(&wait_callback);
         pthread_mutex_unlock(&lock);
     }
 }
@@ -149,7 +142,7 @@ static void snapshot(libvlc_instance_t *vlc, libvlc_media_t *m,
     }
     pthread_mutex_lock(&lock);
     while (!done)
-        pthread_cond_wait(&wait, &lock);
+        pthread_cond_wait(&wait_callback, &lock);
     pthread_mutex_unlock(&lock);
     libvlc_media_thumbnail_request_destroy(req);
     libvlc_event_detach(em, libvlc_MediaThumbnailGenerated, callback, &pic);
@@ -182,7 +175,7 @@ int main(int argc, const char **argv)
 
     cmdline(argc, argv, &in, &out, &out_with_ext, &width);
 
-    pthread_cond_init(&wait, NULL);
+    pthread_cond_init(&wait_callback, NULL);
 
     /* starts vlc */
     libvlc = create_libvlc();
@@ -204,7 +197,7 @@ int main(int argc, const char **argv)
     libvlc_media_release(m);
     libvlc_release(libvlc);
 
-    pthread_cond_destroy(&wait);
+    pthread_cond_destroy(&wait_callback);
 
     return 0;
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/23167a399a2b133d77b93c3814df8eb0def4a6e5...f030c94478d181818e099f49c175ca43fd667ae0

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/23167a399a2b133d77b93c3814df8eb0def4a6e5...f030c94478d181818e099f49c175ca43fd667ae0
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list