Skip to content

Commit

Permalink
Merge pull request #28 from HeavenVolkoff/master
Browse files Browse the repository at this point in the history
Update to minidlna 1.3.3 + Couple extra fixes
  • Loading branch information
NathanaelA authored Sep 30, 2024
2 parents fee22a1 + 483cafb commit b1377ce
Show file tree
Hide file tree
Showing 43 changed files with 1,039 additions and 530 deletions.
9 changes: 6 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ else
minidlnad_SOURCES += select.c
endif

if HAVE_INOTIFY
minidlnad_SOURCES += monitor_inotify.c
endif

if HAVE_VORBISFILE
vorbislibs = -lvorbis -logg
else
Expand All @@ -58,17 +62,16 @@ minidlnad_LDADD = \
@LIBEXIF_LIBS@ \
@LIBINTL@ \
@LIBICONV@ \
-lFLAC $(flacogglibs) $(vorbislibs) $(avahilibs)
-lFLAC $(flacogglibs) $(vorbislibs) $(avahilibs) @LIBFFMPEGTHUMBNAILER_LIBS@

testupnpdescgen_SOURCES = testupnpdescgen.c upnpdescgen.c
testupnpdescgen_LDADD = \
@LIBJPEG_LIBS@ \
@LIBID3TAG_LIBS@ \
@LIBSQLITE3_LIBS@ \
@LIBAVFORMAT_LIBS@ \
@LIBAVUTIL_LIBS@ \
@LIBEXIF_LIBS@ \
-lFLAC $(flacogglibs) $(vorbislibs) $(avahilibs)
-lFLAC $(flacogglibs) $(vorbislibs) $(avahilibs) @LIBFFMPEGTHUMBNAILER_LIBS@

SUFFIXES = .tmpl .

Expand Down
33 changes: 32 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
(P Versions are the Password support versions, we keep the same base "1.x.y" as the upstream version)

1.3.3.1P - Released 30-Sept-2024
--------------------------------
- Fixes in the 1.3.1/1.3.2/1.3.3 Migration
- Make sure database is closed after scanning (https://sources.debian.org/patches/minidlna/1.3.3%2Bdfsg-1.1/03-make-sure-the-database-is-closed-after-scanning.patch)
- Ignore artist when looking up existing container (https://sources.debian.org/patches/minidlna/1.3.3%2Bdfsg-1.1/07-fix-multi-artist-album-handling.patch)
- Fix testupnpdescgen build (https://sources.debian.org/patches/minidlna/1.3.3%2Bdfsg-1.1/08-Fix-testupnpdescgen-build.patch)
- Do not close socket on sighup (https://sources.debian.org/patches/minidlna/1.3.3%2Bdfsg-1.1/10-do-not-close-socket-on-sighup.patch)
- Fix spelling and typos (https://sources.debian.org/patches/minidlna/1.3.3%2Bdfsg-1.1/13-spelling-and-typos.patch)
- Fixes for configure.ac (https://sources.debian.org/patches/minidlna/1.3.3%2Bdfsg-1.1/14-autoupdate.patch)
- Add suport for generating thumbnails with libffmpegthumbnailer (https://sources.debian.org/patches/minidlna/1.3.3%2Bdfsg-1.1/15-thumbnails.patch)
- Add compatibility with FFMPEG 7.0 (https://sources.debian.org/patches/minidlna/1.3.3%2Bdfsg-1.1/16-Add-compatibility-with-FFMPEG-7.0.patch)

1.3.3 - Released 1-Jun-2023
--------------------------------
- Fixed HTTP chunk length parsing.
- Improved Dutch and Swedish translations.
- Fixed directory symlink deletion handling.

1.3.2 - Released 30-Aug-2022
--------------------------------
- Improved DNS rebinding attack protection.
- Added Samsung Neo QLED series (2021) support.
- Added webm/rm/rmvb support.

1.3.1 - Released 11-Feb-2022
--------------------------------
- Fixed a potential crash in SSDP request parsing.
- Fixed a configure script failure on some platforms.
- Protect against DNS rebinding attacks.
- Fix an socket leakage issue on some platforms.
- Minor bug fixes.

1.3.0.1P - Released 20-Aug-2021
--------------------------------
- Fixes in the 1.3.0 Migration (Thanks Vitor, PR #22)
Expand All @@ -11,7 +43,6 @@
- Fix for Image Resize Error (https://sourceforge.net/p/minidlna/patches/189/)
- Fix for negative children (https://sourceforge.net/p/minidlna/patches/187/)


1.3.0P - Released 19-Aug-2021
--------------------------------
- Fixed .nl Translation (Thanks: Juul Wulms, PR #20)
Expand Down
66 changes: 63 additions & 3 deletions albumart.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@

#include <jpeglib.h>

#ifdef THUMBNAIL_CREATION
#include <libffmpegthumbnailer/videothumbnailerc.h>
#endif

#include "upnpglobalvars.h"
#include "albumart.h"
#include "sql.h"
Expand Down Expand Up @@ -86,7 +90,7 @@ save_resized_album_art(image_s *imsrc, const char *path)

cache_file = image_save_to_jpeg_file(imdst, cache_file);
image_free(imdst);

return cache_file;
}

Expand Down Expand Up @@ -348,14 +352,70 @@ check_for_album_file(const char *path)
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;

video_thumbnailer_set_size(vt, runtime_vars.thumb_width, 0);

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 )
Expand Down
1 change: 1 addition & 0 deletions buildroot/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source "$BR2_EXTERNAL_READYMEDIA_PATH/readymedia/Config.in"
13 changes: 13 additions & 0 deletions buildroot/build-static.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash -e
if [ $# -ne 1 ]; then
echo "Usage: $0 <BUILDROOT_PATH>"
exit 1
fi
BUILDROOT_DIR=$1
BR2_DEFCONFIG=$(realpath readymedia_defconfig)
export BR2_EXTERNAL=$(realpath .)
cd $BUILDROOT_DIR
make O=output-readymedia defconfig BR2_DEFCONFIG=${BR2_DEFCONFIG}
make O=output-readymedia
echo -e "\n\nStatic binary built in $(realpath output-readymedia/target/usr/sbin/minidlnad)"
ls -lh $(realpath output-readymedia/target/usr/sbin/minidlnad)
2 changes: 2 additions & 0 deletions buildroot/external.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: READYMEDIA
desc: ReadyMedia external tree
1 change: 1 addition & 0 deletions buildroot/external.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(sort $(wildcard $(BR2_EXTERNAL_READYMEDIA_PATH)/*/*.mk))
24 changes: 24 additions & 0 deletions buildroot/readymedia/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
config BR2_PACKAGE_READYMEDIA
bool "readymedia"
depends on BR2_USE_WCHAR # flac
depends on BR2_USE_MMU # fork
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
select BR2_PACKAGE_FFMPEG
select BR2_PACKAGE_FLAC
select BR2_PACKAGE_LIBVORBIS # selects libogg
select BR2_PACKAGE_LIBOGG
select BR2_PACKAGE_LIBID3TAG # selects zlib
select BR2_PACKAGE_LIBEXIF
select BR2_PACKAGE_JPEG
select BR2_PACKAGE_SQLITE
help
MiniDLNA (aka ReadyDLNA) is server software with the aim of
being fully compliant with DLNA/UPnP-AV clients.

http://minidlna.sourceforge.net/

comment "readymedia needs a toolchain w/ threads, wchar"
depends on BR2_USE_MMU
depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR
31 changes: 31 additions & 0 deletions buildroot/readymedia/readymedia.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
################################################################################
#
# readymedia
#
################################################################################

READYMEDIA_VERSION = v1_3_3
READYMEDIA_SITE = https://git.code.sf.net/p/minidlna/git
#READYMEDIA_SITE = ssh://localhost/home/jmaggard/source/minidlna
READYMEDIA_SITE_METHOD = git
READYMEDIA_LICENSE = GPL-2.0, BSD-3-Clause
READYMEDIA_LICENSE_FILES = COPYING LICENCE.miniupnpd
READYMEDIA_CPE_ID_VENDOR = readymedia_project
READYMEDIA_CPE_ID_PRODUCT = readymedia

READYMEDIA_DEPENDENCIES = \
$(TARGET_NLS_DEPENDENCIES) \
ffmpeg flac libvorbis libogg libid3tag libexif jpeg sqlite \
host-xutil_makedepend

READYMEDIA_CONF_OPTS = \
--enable-static \
--enable-tivo \
--enable-lto

define READYMEDIA_RUN_AUTOGEN
cd $(@D) && PATH=$(BR_PATH) ./autogen.sh
endef
READYMEDIA_PRE_CONFIGURE_HOOKS = READYMEDIA_RUN_AUTOGEN

$(eval $(autotools-package))
28 changes: 28 additions & 0 deletions buildroot/readymedia_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
BR2_SHARED_STATIC_LIBS=y
BR2_TOOLCHAIN_BUILDROOT_VENDOR="readymedia"
BR2_TOOLCHAIN_BUILDROOT_MUSL=y
BR2_KERNEL_HEADERS_VERSION=y
BR2_DEFAULT_KERNEL_VERSION="2.6.32"
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_REALLY_OLD=y
BR2_BINUTILS_VERSION_2_37_X=y
BR2_GCC_VERSION_11_X=y
BR2_GCC_ENABLE_LTO=y
BR2_TARGET_GENERIC_HOSTNAME="readymedia"
BR2_INIT_NONE=y
# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
# BR2_TARGET_GENERIC_GETTY is not set
# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_FFMPEG_ENCODERS=""
BR2_PACKAGE_FFMPEG_DECODERS="aac alac eac3 flac flv h264 mp3 mpeg2video mpeg4 pcm_s16be pcm_s16le vorbis wmalossless wmapro wmav1 wmav2"
BR2_PACKAGE_FFMPEG_MUXERS=""
BR2_PACKAGE_FFMPEG_DEMUXERS="aac ac3 aiff asf avi dts dv eac3 flac flv h261 h263 h264 matroska mjpeg mov m4v mp3 mpegps mpegts mpegtsraw mpegvideo ogg vc1 wav"
BR2_PACKAGE_FFMPEG_PARSERS="aac ac3 dvbsub dvdsub flac h261 h263 h264 mjpeg mlp mpeg4video mpegaudio mpegvideo vc1 vorbis vp3 vp8"
BR2_PACKAGE_FFMPEG_BSFS=""
BR2_PACKAGE_FFMPEG_PROTOCOLS="file"
BR2_PACKAGE_FFMPEG_FILTERS=""
# BR2_PACKAGE_FFMPEG_INDEVS is not set
# BR2_PACKAGE_FFMPEG_OUTDEVS is not set
BR2_PACKAGE_FFMPEG_EXTRACONF="--enable-small --disable-pic --disable-avfilter --disable-libvorbis --disable-network --disable-muxer=ogg"
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
BR2_PACKAGE_READYMEDIA=y
15 changes: 12 additions & 3 deletions clients.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ struct client_type_s client_types[] =
EXAVClientInfo
},

{ ECling,
{ ECling,
FLAG_MS_PFS,
"Cling",
"Cling/",
EUserAgent
},
},

/* User-Agent: DLNADOC/1.50 SEC_HHP_[PC]LPC001/1.0 MS-DeviceCaps/1024 */
/* This is AllShare running on a PC. We don't want to respond with Samsung
Expand Down Expand Up @@ -89,7 +89,7 @@ struct client_type_s client_types[] =
EUserAgent
},

/* Samsung Series [Q] TVs work wit milliseconds for bookmarks */
/* Samsung Series [Q] TVs work with milliseconds for bookmarks */
/* User-Agent: DLNADOC/1.50 SEC_HHP_[TV] Samsung Q7 Series (49)/1.0 */
{ ESamsungSeriesQ,
FLAG_SAMSUNG | FLAG_DLNA | FLAG_NO_RESIZE | FLAG_SAMSUNG_DCM10 | FLAG_CAPTION_RES | FLAG_CONVERT_MS,
Expand All @@ -98,6 +98,15 @@ struct client_type_s client_types[] =
EUserAgent
},

/* Samsung Series [QN] TVs work with milliseconds for bookmarks */
/* User-Agent: DLNADOC/1.50 SEC_HHP_Samsung QN90AA 50 TV/1.0 */
{ ESamsungSeriesQ,
FLAG_SAMSUNG | FLAG_DLNA | FLAG_NO_RESIZE | FLAG_SAMSUNG_DCM10 | FLAG_CAPTION_RES | FLAG_CONVERT_MS,
"Samsung Series [QN]",
"SEC_HHP_Samsung QN",
EUserAgent
},

/* User-Agent: DLNADOC/1.50 SEC_HHP_[TV]UE40D7000/1.0 */
/* User-Agent: DLNADOC/1.50 SEC_HHP_ Family TV/1.0 */
/* USER-AGENT: DLNADOC/1.50 SEC_HHP_[TV] UE65JU7000/1.0 UPnP/1.0 */
Expand Down
Loading

0 comments on commit b1377ce

Please sign in to comment.