Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package minidlna for openSUSE:Factory 
checked in at 2024-08-21 23:27:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/minidlna (Old)
 and      /work/SRC/openSUSE:Factory/.minidlna.new.2698 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "minidlna"

Wed Aug 21 23:27:45 2024 rev:11 rq:1195167 version:1.3.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/minidlna/minidlna.changes        2024-05-29 
19:36:12.121249439 +0200
+++ /work/SRC/openSUSE:Factory/.minidlna.new.2698/minidlna.changes      
2024-08-21 23:28:03.694701004 +0200
@@ -1,0 +2,31 @@
+Wed Aug 21 18:06:14 CEST 2024 - r...@suse.de
+
+- add some of debian's patches and switch back to ffmpeg-7
+- added patches:
+  - 01-run-instead-of-var-run.patch
+    use /run for runtime generated files
+  - 07-fix-multi-artist-album-handling.patch
+    fix for compilation albums
+  - 08-Fix-testupnpdescgen-build.patch
+    skip unneccessary lib when linking
+  - 10-do-not-close-socket-on-sighup.patch
+    no need to restart the interfaces when we just rescan
+  - 13-spelling-and-typos.patch
+    cleanup error message
+  - 15-thumbnails.patch
+    use ffmpegthumbnailer
+  - 16-Add-compatibility-with-FFMPEG-7.0.patch
+    fix build with current ffmpeg
+- add br for pkgconfig(libffmpegthumbnailer)
+ 
+-------------------------------------------------------------------
+Wed Aug 21 07:46:03 UTC 2024 - Manfred Hollstein <manfre...@gmx.net>
+
+- Don't use ffmpeg-7 as compilation of several files fails with
+  error messages like:
+  ...
+  libav.h:177:36: error: ‘AVCodecParameters’ has no member named 
‘channels’
+  metadata.c:828:30: note: in expansion of macro ‘lav_channels’
+  ...
+
+-------------------------------------------------------------------

New:
----
  01-run-instead-of-var-run.patch
  07-fix-multi-artist-album-handling.patch
  08-Fix-testupnpdescgen-build.patch
  10-do-not-close-socket-on-sighup.patch
  13-spelling-and-typos.patch
  15-thumbnails.patch
  16-Add-compatibility-with-FFMPEG-7.0.patch

BETA DEBUG BEGIN:
  New:- added patches:
  - 01-run-instead-of-var-run.patch
    use /run for runtime generated files
  New:    use /run for runtime generated files
  - 07-fix-multi-artist-album-handling.patch
    fix for compilation albums
  New:    fix for compilation albums
  - 08-Fix-testupnpdescgen-build.patch
    skip unneccessary lib when linking
  New:    skip unneccessary lib when linking
  - 10-do-not-close-socket-on-sighup.patch
    no need to restart the interfaces when we just rescan
  New:    no need to restart the interfaces when we just rescan
  - 13-spelling-and-typos.patch
    cleanup error message
  New:    cleanup error message
  - 15-thumbnails.patch
    use ffmpegthumbnailer
  New:    use ffmpegthumbnailer
  - 16-Add-compatibility-with-FFMPEG-7.0.patch
    fix build with current ffmpeg
BETA DEBUG END:

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

Other differences:
------------------
++++++ minidlna.spec ++++++
--- /var/tmp/diff_new_pack.sKMAo9/_old  2024-08-21 23:28:04.226723164 +0200
+++ /var/tmp/diff_new_pack.sKMAo9/_new  2024-08-21 23:28:04.226723164 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package minidlna
 #
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
 # Copyright (c) 2012 by Lars Vogdt <l...@linux-schulserver.de>
 #
 # All modifications and additions to the file contributed by third parties
@@ -36,6 +36,13 @@
 Source4:        %{name}-user.conf
 # VDR FIX thanks to Boris from openSuse
 Patch1:         minidlna-vdr.diff
+Patch2:         01-run-instead-of-var-run.patch
+Patch3:         07-fix-multi-artist-album-handling.patch
+Patch4:         08-Fix-testupnpdescgen-build.patch
+Patch5:         10-do-not-close-socket-on-sighup.patch
+Patch6:         13-spelling-and-typos.patch
+Patch7:         15-thumbnails.patch
+Patch8:         16-Add-compatibility-with-FFMPEG-7.0.patch
 BuildRequires:  automake
 BuildRequires:  flac-devel
 BuildRequires:  libexif-devel
@@ -49,6 +56,7 @@
 BuildRequires:  pkgconfig(libavcodec)
 BuildRequires:  pkgconfig(libavformat)
 BuildRequires:  pkgconfig(libavutil)
+BuildRequires:  pkgconfig(libffmpegthumbnailer)
 Recommends:     logrotate
 Provides:       ReadyMedia = %{version}
 %sysusers_requires
@@ -72,6 +80,7 @@
 %configure \
   --with-db-path=%{_localstatedir}/cache/%{name} \
   --with-log-path=%{_localstatedir}/log/%{name} \
+  --enable-thumbnail \
   --enable-tivo
 
 make %{?_smp_mflags}
@@ -85,7 +94,7 @@
 install -D -m0644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{name}.conf
 #
 install -d %{buildroot}%{_sbindir}
-ln -s /sbin/service %{buildroot}%{_sbindir}/rc%{name}
+ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
 # install logrotate file
 install -D -m0644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/logrotate.d/%{name}
 # install cache directory

++++++ 01-run-instead-of-var-run.patch ++++++
From: =?utf-8?q?Beno=C3=AEt_Knecht?= <benoit.kne...@fsfe.org>
Date: Sun, 1 Mar 2015 22:11:34 +0100
Subject: Use /run instead of /var/run to store runtime files

---
 upnpglobalvars.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/upnpglobalvars.c b/upnpglobalvars.c
index 1625bdb..d5b15d4 100644
--- a/upnpglobalvars.c
+++ b/upnpglobalvars.c
@@ -60,7 +60,7 @@ time_t startup_time = 0;
 struct runtime_vars_s runtime_vars;
 uint32_t runtime_flags = INOTIFY_MASK | TIVO_BONJOUR_MASK | SUBTITLES_MASK;
 
-const char *pidfilename = "/var/run/minidlna/minidlna.pid";
+const char *pidfilename = "/run/minidlna/minidlna.pid";
 
 char uuidvalue[] = "uuid:00000000-0000-0000-0000-000000000000";
 char modelname[MODELNAME_MAX_LEN] = ROOTDEV_MODELNAME;
@@ -76,7 +76,7 @@ struct lan_addr_s lan_addr[MAX_LAN_ADDR];
 int sssdp = -1;
 
 /* Path of the Unix socket used to communicate with MiniSSDPd */
-const char * minissdpdsocketpath = "/var/run/minissdpd.sock";
+const char * minissdpdsocketpath = "/run/minissdpd.sock";
 
 /* UPnP-A/V [DLNA] */
 sqlite3 *db;

++++++ 07-fix-multi-artist-album-handling.patch ++++++
From: Florian Will <florian.w...@gmail.com>
Date: Mon, 9 Mar 2015 13:18:56 +0300
Subject: [PATCH] Ignore artist when looking up existing container
Forwarded: http://sourceforge.net/p/minidlna/bugs/246/
Bug-Debian: https://bugs.debian.org/734383

This prevents creation of multiple album containers for compilation
albums (i.e. one separate album for each artist) when adding files via
inotify, which causes the scanner cache to be invalidated all the time.

OTOH, different albums with identical names ("Greatest Hits", "Love
Songs") are now listed as just a single album in the "Album" container.
This might be solved using some heuristic based on music file location
(same directory / different directories).

The new behaviour is usually the same as encountered when doing a full
rescan, because there's a scanner cache that is used during full rescans
and that cache ignores artist names as well.
---
 scanner.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/scanner.c b/scanner.c
index f240a2f..b9ee514 100644
--- a/scanner.c
+++ b/scanner.c
@@ -98,9 +98,8 @@ insert_container(const char *item, const char *rootParent, 
const char *refID, co
                                        "left join DETAILS d on (o.DETAIL_ID = 
d.ID)"
                                        " where o.PARENT_ID = '%s'"
                                        " and o.NAME like '%q'"
-                                       " and d.ARTIST %s %Q"
                                        " and o.CLASS = 'container.%s' limit 1",
-                                       rootParent, item, artist?"like":"is", 
artist, class);
+                                       rootParent, item, class);
        if( result )
        {
                base = strrchr(result, '$');

++++++ 08-Fix-testupnpdescgen-build.patch ++++++
From: Alexander Gerasiov <a...@gerasiov.net>
Date: Sat, 5 Dec 2020 14:24:52 +0300
Subject: Fix testupnpdescgen build.

Signed-off-by: Alexander Gerasiov <a...@gerasiov.net>
---
 Makefile.am | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 1e33833..dcfc625 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -70,7 +70,6 @@ testupnpdescgen_LDADD = \
        @LIBID3TAG_LIBS@ \
        @LIBSQLITE3_LIBS@ \
        @LIBAVFORMAT_LIBS@ \
-       @LIBAVUTIL_LIBS@ \
        @LIBEXIF_LIBS@ \
        -lFLAC $(flacogglibs) $(vorbislibs) $(avahilibs)
 

++++++ 10-do-not-close-socket-on-sighup.patch ++++++
From: Alexander GQ Gerasiov <g...@debian.org>
Date: Sun, 31 Jan 2021 18:55:16 +0300
Subject: do-not-close-socket-on-sighup

---
 minidlna.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/minidlna.c b/minidlna.c
index 47ca712..37462ac 100644
--- a/minidlna.c
+++ b/minidlna.c
@@ -215,8 +215,6 @@ sighup(int sig)
 {
        signal(sig, sighup);
        DPRINTF(E_WARN, L_GENERAL, "received signal %d, reloading\n", sig);
-
-       reload_ifaces(1);
        log_reopen();
 }
 

++++++ 13-spelling-and-typos.patch ++++++
From: "Barak A. Pearlmutter" <barak+...@pearlmutter.net>
Date: Sun, 13 Nov 2022 20:05:44 +0000
Subject: spelling and typos

---
 minidlna.c | 2 +-
 upnphttp.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/minidlna.c b/minidlna.c
index 37462ac..6d2d06b 100644
--- a/minidlna.c
+++ b/minidlna.c
@@ -525,7 +525,7 @@ static void init_nls(void)
        if (!messages)
                messages = "unset";
        locale_dir = bindtextdomain("minidlna", getenv("TEXTDOMAINDIR"));
-       DPRINTF(E_DEBUG, L_GENERAL, "Using locale dir '%s' and locale langauge 
%s/%s\n", locale_dir, messages, ctype);
+       DPRINTF(E_DEBUG, L_GENERAL, "Using locale dir '%s' and locale language 
%s/%s\n", locale_dir, messages, ctype);
        textdomain("minidlna");
 #endif
 }
diff --git a/upnphttp.c b/upnphttp.c
index 477ebef..5d230cb 100644
--- a/upnphttp.c
+++ b/upnphttp.c
@@ -556,7 +556,7 @@ Send500(struct upnphttp * h)
                "<BODY><H1>Internal Server Error</H1>Server encountered "
                "and Internal Error.</BODY></HTML>\r\n";
        h->respflags = FLAG_HTML;
-       BuildResp2_upnphttp(h, 500, "Internal Server Errror",
+       BuildResp2_upnphttp(h, 500, "Internal Server Error",
                            body500, sizeof(body500) - 1);
        SendResp_upnphttp(h);
        CloseSocket_upnphttp(h);

++++++ 15-thumbnails.patch ++++++
From: "Barak A. Pearlmutter" <barak+...@pearlmutter.net>
Date: Mon, 21 Aug 2023 12:00:00 +0000
Subject: thumbnails

This patch is from
https://sourceforge.net/p/minidlna/patches/_discuss/thread/28a9f79d/9aca/attachment/minidlna-1.3.3-thumb.patch
by https://sourceforge.net/u/wilderman/profile/
with changes to derived and cache files (configure and such) removed.
---
 Makefile.am       |  4 ++--
 albumart.c        | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 configure.ac      | 15 ++++++++++++++
 minidlna.c        | 29 ++++++++++++++++++++++++++
 minidlna.conf     | 12 +++++++++++
 minidlnatypes.h   |  4 ++++
 monitor.c         |  8 +++++++
 monitor_inotify.c | 25 ++++++++++++++++++++++
 options.c         |  6 ++++++
 options.h         |  6 ++++++
 upnpglobalvars.h  |  5 +++++
 utils.c           | 14 +++++++++++++
 utils.h           |  3 +++
 13 files changed, 189 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index dcfc625..603ee03 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -62,7 +62,7 @@ minidlnad_LDADD = \
        @LIBEXIF_LIBS@ \
        @LIBINTL@ \
        @LIBICONV@ \
-       -lFLAC $(flacogglibs) $(vorbislibs) $(avahilibs)
+       -lFLAC $(flacogglibs) $(vorbislibs) $(avahilibs)  
@LIBFFMPEGTHUMBNAILER_LIBS@
 
 testupnpdescgen_SOURCES = testupnpdescgen.c upnpdescgen.c
 testupnpdescgen_LDADD = \
@@ -71,7 +71,7 @@ testupnpdescgen_LDADD = \
        @LIBSQLITE3_LIBS@ \
        @LIBAVFORMAT_LIBS@ \
        @LIBEXIF_LIBS@ \
-       -lFLAC $(flacogglibs) $(vorbislibs) $(avahilibs)
+       -lFLAC $(flacogglibs) $(vorbislibs) $(avahilibs) 
@LIBFFMPEGTHUMBNAILER_LIBS@
 
 SUFFIXES = .tmpl .
 
diff --git a/albumart.c b/albumart.c
index de026ec..28f174b 100644
--- a/albumart.c
+++ b/albumart.c
@@ -32,6 +32,10 @@
 
 #include <jpeglib.h>
 
+#ifdef THUMBNAIL_CREATION
+#include <libffmpegthumbnailer/videothumbnailerc.h>
+#endif
+
 #include "upnpglobalvars.h"
 #include "albumart.h"
 #include "sql.h"
@@ -348,14 +352,68 @@ found_file:
        return NULL;
 }
 
+#ifdef THUMBNAIL_CREATION
+char *
+generate_thumbnail(const char * path)
+{
+       char *tfile = NULL;
+       video_thumbnailer *vt = NULL;
+       char cache_dir[MAXPATHLEN];
+
+       if( art_cache_exists(path, &tfile) )
+               return tfile;
+
+       if ( is_video(path) )
+       {
+
+               vt = video_thumbnailer_create();
+               if ( !vt )
+               {
+                       free(tfile);
+                       return 0;
+               }
+               vt->thumbnail_image_type = Jpeg;
+               vt->thumbnail_image_quality = runtime_vars.thumb_quality;
+               vt->thumbnail_size = runtime_vars.thumb_width;
+               vt->seek_percentage = 20;
+               vt->overlay_film_strip = (GETFLAG(THUMB_FILMSTRIP))?1:0;
+
+               DPRINTF(E_DEBUG, L_METADATA, "generating thumbnail: %s\n", 
path);
+
+               strncpyt(cache_dir, tfile, sizeof(cache_dir));
+               if ( !make_dir(dirname(cache_dir), 
S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) &&
+                       !video_thumbnailer_generate_thumbnail_to_file(vt, path, 
tfile) )
+               {
+                       video_thumbnailer_destroy(vt);
+                       return tfile;
+               }
+
+               video_thumbnailer_destroy(vt);
+       }
+       free(tfile);
+
+       return 0;
+}
+#endif
+
 int64_t
 find_album_art(const char *path, uint8_t *image_data, int image_size)
 {
        char *album_art = NULL;
        int64_t ret = 0;
 
-       if( (image_size && (album_art = check_embedded_art(path, image_data, 
image_size))) ||
-           (album_art = check_for_album_file(path)) )
+       if(image_size)
+               album_art = check_embedded_art(path, image_data, image_size);
+
+       if(!album_art)
+               album_art = check_for_album_file(path);
+
+#ifdef THUMBNAIL_CREATION
+       if(!album_art && GETFLAG(THUMB_MASK))
+               album_art = generate_thumbnail(path);
+#endif
+
+       if(album_art)
        {
                ret = sql_get_int_field(db, "SELECT ID from ALBUM_ART where 
PATH = '%q'", album_art);
                if( !ret )
diff --git a/configure.ac b/configure.ac
index 11421a5..2c3278b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -642,6 +642,21 @@ AC_ARG_ENABLE(lto,
         ]
 )
 
+AC_ARG_ENABLE(thumbnail,
+       [  --enable-thumbnail       enable video thumbnail generation using 
libffmpegthumbnailer],[
+       if test "$enableval" = "yes"; then
+               AC_DEFINE([THUMBNAIL_CREATION],[1],[Define to 1 if you want to 
enable video thumbnail generation])
+               PKG_CHECK_MODULES([LIBFFMPEGTHUMBNAILER], libffmpegthumbnailer, 
,
+                       AC_MSG_ERROR([Unable to find libffmpegthumbnailer]))
+               AC_SUBST([LIBFFMPEGTHUMBNAILER_CFLAGS])
+               AC_SUBST([LIBFFMPEGTHUMBNAILER_LIBS])
+        else
+                AC_MSG_RESULT([no])
+        fi
+        ],[
+                AC_MSG_RESULT([no])
+        ]
+)
 
 case "$target_os" in
        darwin*)
diff --git a/minidlna.c b/minidlna.c
index 6d2d06b..74e1fac 100644
--- a/minidlna.c
+++ b/minidlna.c
@@ -589,6 +589,11 @@ init(int argc, char **argv)
        runtime_vars.root_container = NULL;
        runtime_vars.ifaces[0] = NULL;
 
+#ifdef THUMBNAIL_CREATION
+       runtime_vars.thumb_width = 160;
+       runtime_vars.thumb_quality = 8;
+#endif
+
        /* read options file first since
         * command line arguments have final say */
        if (readoptionsfile(optionsfile) < 0)
@@ -812,6 +817,30 @@ init(int argc, char **argv)
                        if (!strtobool(ary_options[i].value))
                                CLEARFLAG(SUBTITLES_MASK);
                        break;
+#ifdef THUMBNAIL_CREATION
+               case ENABLE_THUMB:
+                       if( (strcmp(ary_options[i].value, "yes") == 0) || 
atoi(ary_options[i].value) )
+                               SETFLAG(THUMB_MASK);
+               break;
+               case THUMB_WIDTH:
+                       runtime_vars.thumb_width = atoi(ary_options[i].value);
+                       if (runtime_vars.thumb_width < 120)
+                               runtime_vars.thumb_width = 120;
+                       if (runtime_vars.thumb_width > 480)
+                               runtime_vars.thumb_width = 480;
+                       break;
+               case THUMB_QUALITY:
+                       runtime_vars.thumb_quality = atoi(ary_options[i].value);
+                       if (runtime_vars.thumb_quality < 5)
+                               runtime_vars.thumb_quality = 5;
+                       if (runtime_vars.thumb_quality > 30)
+                               runtime_vars.thumb_quality = 30;
+               break;
+               case ENABLE_THUMB_FILMSTRIP:
+                       if( (strcmp(ary_options[i].value, "yes") == 0) || 
atoi(ary_options[i].value) )
+                               SETFLAG(THUMB_FILMSTRIP);
+               break;
+#endif
                default:
                        DPRINTF(E_ERROR, L_GENERAL, "Unknown option in file 
%s\n",
                                optionsfile);
diff --git a/minidlna.conf b/minidlna.conf
index 82db5f1..f6ededf 100644
--- a/minidlna.conf
+++ b/minidlna.conf
@@ -95,3 +95,15 @@ model_number=1
 # enable subtitle support by default on unknown clients.
 # note: the default is yes
 #enable_subtitles=yes
+
+# Suport to Movie Thumbnail generation. To use this option, thumbnail 
generation must be enable at compile time.
+#enable_thumbnail=no
+
+# The width of the thumbnail image. Large images takes more time to generate.  
To use this option, thumbnail generation must be enable at compile time.
+#thumbnail_width=160
+
+# Thumbnail Image quality. To use this option, thumbnail generation must be 
enable at compile time.
+#thumbnail_quality=8
+
+# Should the thumbnail have a film strip? To use this option, thumbnail 
generation must be enable at compile time.
+#enable_thumbnail_filmstrip=no
diff --git a/minidlnatypes.h b/minidlnatypes.h
index a92cc7d..98f91b1 100644
--- a/minidlnatypes.h
+++ b/minidlnatypes.h
@@ -51,6 +51,10 @@ struct runtime_vars_s {
        int max_connections;    /* max number of simultaneous conenctions */
        const char *root_container;     /* root ObjectID (instead of "0") */
        const char *ifaces[MAX_LAN_ADDR];       /* list of configured network 
interfaces */
+#ifdef THUMBNAIL_CREATION
+       int thumb_width;
+       int thumb_quality;
+#endif
 };
 
 struct string_s {
diff --git a/monitor.c b/monitor.c
index b5757d9..f064ee5 100644
--- a/monitor.c
+++ b/monitor.c
@@ -117,6 +117,14 @@ monitor_remove_file(const char * path)
                sql_exec(db, "DELETE from OBJECTS where DETAIL_ID = %lld", 
detailID);
        }
        snprintf(art_cache, sizeof(art_cache), "%s/art_cache%s", db_path, path);
+#ifdef THUMBNAIL_CREATION
+       /* Remove video thumbnails */
+       if ( is_video(path) )
+       {
+               char *vthumb = art_cache;
+               strcpy(strchr(vthumb, '\0')-4, ".jpg");
+       }
+#endif
        remove(art_cache);
 
        return 0;
diff --git a/monitor_inotify.c b/monitor_inotify.c
index 365b3fe..d051dd0 100644
--- a/monitor_inotify.c
+++ b/monitor_inotify.c
@@ -265,6 +265,10 @@ inotify_thread(void *arg)
        char * esc_name = NULL;
        struct stat st;
        sigset_t set;
+#ifdef THUMBNAIL_CREATION
+       char renpath_buf[PATH_MAX];
+       int cookie = 0;
+#endif
 
        sigfillset(&set);
        sigdelset(&set, SIGCHLD);
@@ -332,6 +336,16 @@ inotify_thread(void *arg)
                                {
                                        DPRINTF(E_DEBUG, L_INOTIFY,  "The 
directory %s was %s.\n",
                                                path_buf, (event->mask & 
IN_MOVED_TO ? "moved here" : "created"));
+#ifdef THUMBNAIL_CREATION
+                                       /* We do not want to regenerate the 
thumbnails if e rename a directory.
+                                          We should keep at least four 
cookies/olddir since IN_MOVED_FROM/IN_MOVED_TO may
+                                          not arrive in sequence, but one 
should cover most cases */
+                                       if (event->cookie == cookie && 
event->mask & IN_MOVED_TO)
+                                       {
+                                               DPRINTF(E_DEBUG, L_INOTIFY, 
"Directory rename: %s -> %s \n", renpath_buf, path_buf);
+                                               
rename_artcache_dir(renpath_buf, path_buf);
+                                       }
+#endif
                                        monitor_insert_directory(pollfds[0].fd, 
esc_name, path_buf);
                                }
                                else if ( (event->mask & 
(IN_CLOSE_WRITE|IN_MOVED_TO|IN_CREATE)) &&
@@ -364,7 +378,18 @@ inotify_thread(void *arg)
                                                (event->mask & IN_ISDIR ? 
"directory" : "file"),
                                                path_buf, (event->mask & 
IN_MOVED_FROM ? "moved away" : "deleted"));
                                        if ( event->mask & IN_ISDIR )
+#ifdef THUMBNAIL_CREATION
+                                       {
+                                               if ( event->mask & 
IN_MOVED_FROM )
+                                               {
+                                                       strncpy(renpath_buf, 
path_buf, sizeof(renpath_buf));
+                                                       cookie = event->cookie;
+                                               }
+#endif
                                                
monitor_remove_directory(pollfds[0].fd, path_buf);
+#ifdef THUMBNAIL_CREATION
+                                       }       
+#endif
                                        else
                                        {
                                                monitor_remove_file(path_buf);
diff --git a/options.c b/options.c
index cee3dff..f161d60 100644
--- a/options.c
+++ b/options.c
@@ -68,6 +68,12 @@ static const struct {
        { WIDE_LINKS, "wide_links" },
        { TIVO_DISCOVERY, "tivo_discovery" },
        { ENABLE_SUBTITLES, "enable_subtitles" },
+#ifdef THUMBNAIL_CREATION
+       { ENABLE_THUMB, "enable_thumbnail" },
+       { THUMB_WIDTH, "thumbnail_width" },
+       { THUMB_QUALITY, "thumbnail_quality" },
+       { ENABLE_THUMB_FILMSTRIP, "enable_thumbnail_filmstrip" },
+#endif
 };
 
 int
diff --git a/options.h b/options.h
index 1ff5b22..0e8c53c 100644
--- a/options.h
+++ b/options.h
@@ -61,6 +61,12 @@ enum upnpconfigoptions {
        WIDE_LINKS,                     /* allow following symlinks outside the 
defined media_dirs */
        TIVO_DISCOVERY,                 /* TiVo discovery protocol: bonjour or 
beacon. Defaults to bonjour if supported */
        ENABLE_SUBTITLES,               /* Enable generic subtitle support for 
all clients by default */
+#ifdef THUMBNAIL_CREATION
+       ENABLE_THUMB,                   /* enable thumbnail generation */
+       THUMB_WIDTH,                    /* thunbnail image with */
+       THUMB_QUALITY,                  /* thumnail image quality */
+       ENABLE_THUMB_FILMSTRIP          /* film strip overlay */
+#endif
 };
 
 /* readoptionsfile()
diff --git a/upnpglobalvars.h b/upnpglobalvars.h
index 8a35555..66be7ba 100644
--- a/upnpglobalvars.h
+++ b/upnpglobalvars.h
@@ -208,6 +208,11 @@ extern uint32_t runtime_flags;
 #define SUBTITLES_MASK        0x0400
 #define FORCE_ALPHASORT_MASK  0x0800
 
+#ifdef THUMBNAIL_CREATION
+#define THUMB_MASK            0x1000
+#define THUMB_FILMSTRIP       0x2000
+#endif
+
 #define SETFLAG(mask)  runtime_flags |= mask
 #define GETFLAG(mask)  (runtime_flags & mask)
 #define CLEARFLAG(mask)        runtime_flags &= ~mask
diff --git a/utils.c b/utils.c
index 03ba850..eb809b8 100644
--- a/utils.c
+++ b/utils.c
@@ -576,3 +576,17 @@ timevalfix(struct timeval *t1)
                t1->tv_usec -= 1000000;
        }
 }
+
+#ifdef THUMBNAIL_CREATION
+int
+rename_artcache_dir(const char * oldpath, const char * newpath)
+{
+       char old_artcache[PATH_MAX];
+       char new_artcache[PATH_MAX];
+
+       snprintf(old_artcache, sizeof(old_artcache), "%s/art_cache%s", db_path, 
oldpath);
+       snprintf(new_artcache, sizeof(old_artcache), "%s/art_cache%s", db_path, 
newpath);
+
+       return rename(old_artcache, new_artcache);
+}
+#endif
diff --git a/utils.h b/utils.h
index 84b9923..641b57b 100644
--- a/utils.h
+++ b/utils.h
@@ -100,6 +100,9 @@ const char *mime_to_ext(const char * mime);
 /* Others */
 int make_dir(char * path, mode_t mode);
 unsigned int DJBHash(uint8_t *data, int len);
+#ifdef THUMBNAIL_CREATION
+int rename_artcache_dir(const char * oldpath, const char * newpath);
+#endif
 
 /* Timeval manipulations */
 void   timevaladd(struct timeval *t1, const struct timeval *t2);

++++++ 16-Add-compatibility-with-FFMPEG-7.0.patch ++++++
>From 243cf2dd27ebcaf4ef1093c79b96077378d52018 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebo...@gmail.com>
Date: Sat, 4 May 2024 18:36:58 +0200
Subject: [PATCH] Add compatibility with FFMPEG 7.0
Origin: other, 
https://sourceforge.net/u/eclipseo/minidlna/ci/243cf2dd27ebcaf4ef1093c79b96077378d52018/
Bug-Debian: https://bugs.debian.org/1072435

channel_layout has been replaced with ch_layout
---
 libav.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libav.h b/libav.h
index b69752c..fae094b 100644
--- a/libav.h
+++ b/libav.h
@@ -117,6 +117,8 @@ typedef AVMetadataTag AVDictionaryEntry;
 # endif
 #endif
 
+#define HAVE_CH_LAYOUT (LIBAVUTIL_VERSION_INT >= ((57<<16)+(28<<8)+100))
+
 static inline int
 lav_open(AVFormatContext **ctx, const char *filename)
 {
@@ -174,7 +176,11 @@ lav_get_interlaced(AVStream *s)
 #define lav_codec_tag(s) s->codecpar->codec_tag
 #define lav_sample_rate(s) s->codecpar->sample_rate
 #define lav_bit_rate(s) s->codecpar->bit_rate
+#if HAVE_CH_LAYOUT
+#define lav_channels(s) s->codecpar->ch_layout.nb_channels
+#else
 #define lav_channels(s) s->codecpar->channels
+#endif
 #define lav_width(s) s->codecpar->width
 #define lav_height(s) s->codecpar->height
 #define lav_profile(s) s->codecpar->profile
-- 
2.45.2

Reply via email to