From 22dadfaa3c78de56e25b6427cfd3fb07d3a50855 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Sun, 15 Dec 2024 10:28:28 +0300 Subject: [PATCH] mpg123-1.32.10 --- NEWS | 11 +++++++++++ configure | 20 ++++++++++---------- mpg123.spec | 2 +- ports/cmake/src/CMakeLists.txt | 12 ++++++++++++ ports/cmake/src/libmpg123/CMakeLists.txt | 7 +++++++ ports/cmake/src/libout123/CMakeLists.txt | 15 +++++++++++++++ ports/cmake/src/libsyn123/CMakeLists.txt | 7 +++++-- scripts/tag_lyrics.py | 24 ++++++++++++------------ src/libmpg123/format.c | 2 +- src/libmpg123/id3.c | 2 +- src/libmpg123/mpg123lib_intern.h | 5 ++++- src/libmpg123/optimize.c | 2 +- src/libout123/libout123.c | 7 ++++--- src/libout123/modules/sndio.c | 6 ++++-- src/version.h | 2 +- 15 files changed, 89 insertions(+), 35 deletions(-) diff --git a/NEWS b/NEWS index f43a3ca..7647301 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,14 @@ +1.32.10 +------ +- scripts/tag_lyrics.py: fix for python3 (thanks to cclauss, + github PR 16) +- libout123: Use strtok_r() to avoid conflicts multithreaded contexts + (both sides should avoid plain strtok()! Debian-bug 1089543). +- libmpg123: +-- Un-break DLL builds that need I/O functions defined in libmpg123.c + (like mpg123_open(), bug 374). +- ports/cmake: More fixup to also produce .pc files with Libs.private. + 1.32.9 ------ - libmpg123: diff --git a/configure b/configure index fa80ce1..743fcba 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for mpg123 1.32.9. +# Generated by GNU Autoconf 2.71 for mpg123 1.32.10. # # Report bugs to . # @@ -621,8 +621,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='mpg123' PACKAGE_TARNAME='mpg123' -PACKAGE_VERSION='1.32.9' -PACKAGE_STRING='mpg123 1.32.9' +PACKAGE_VERSION='1.32.10' +PACKAGE_STRING='mpg123 1.32.10' PACKAGE_BUGREPORT='maintainer@mpg123.org' PACKAGE_URL='' @@ -1727,7 +1727,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures mpg123 1.32.9 to adapt to many kinds of systems. +\`configure' configures mpg123 1.32.10 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1798,7 +1798,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of mpg123 1.32.9:";; + short | recursive ) echo "Configuration of mpg123 1.32.10:";; esac cat <<\_ACEOF @@ -2076,7 +2076,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -mpg123 configure 1.32.9 +mpg123 configure 1.32.10 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2621,7 +2621,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by mpg123 $as_me 1.32.9, which was +It was created by mpg123 $as_me 1.32.10, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3991,7 +3991,7 @@ fi # Define the identity of the package. PACKAGE='mpg123' - VERSION='1.32.9' + VERSION='1.32.10' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -22453,7 +22453,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by mpg123 $as_me 1.32.9, which was +This file was extended by mpg123 $as_me 1.32.10, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22521,7 +22521,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -mpg123 config.status 1.32.9 +mpg123 config.status 1.32.10 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/mpg123.spec b/mpg123.spec index 9076790..7692bd5 100644 --- a/mpg123.spec +++ b/mpg123.spec @@ -3,7 +3,7 @@ # - devel packages for alsa, sdl, etc... to build the respective output modules. Summary: The fast console mpeg audio decoder/player. Name: mpg123 -Version: 1.32.9 +Version: 1.32.10 Release: 1 URL: http://www.mpg123.org/ License: GPL diff --git a/ports/cmake/src/CMakeLists.txt b/ports/cmake/src/CMakeLists.txt index 32bc03c..93ef004 100644 --- a/ports/cmake/src/CMakeLists.txt +++ b/ports/cmake/src/CMakeLists.txt @@ -41,6 +41,14 @@ function(check_m) check_function_exists(sin HAVE_M) endfunction(check_m) check_m() +# Cargo coding the check if there is a library rt, possibly providing +# a canary symbol. I am not sure if this logic really mirrors what +# autotools does. +function(check_rt) + set(CMAKE_REQUIRED_LIBRARIES rt) + check_function_exists(clock_gettime HAVE_RT) +endfunction(check_rt) +check_rt() check_function_exists(atoll HAVE_ATOLL) check_function_exists(getaddrinfo HAVE_IPV6) @@ -450,3 +458,7 @@ if(UNIX AND NOT PORTABLE_API) endif() configure_file(config.cmake.h.in config.h) + +set(LIBMPG123_LIBS "${LIBMPG123_LIBS}" PARENT_SCOPE) +set(LIBOUT123_LIBS "${LIBOUT123_LIBS}" PARENT_SCOPE) +set(LIBSYN123_LIBS "${LIBSYN123_LIBS}" PARENT_SCOPE) diff --git a/ports/cmake/src/libmpg123/CMakeLists.txt b/ports/cmake/src/libmpg123/CMakeLists.txt index 7cb08be..3e1c042 100644 --- a/ports/cmake/src/libmpg123/CMakeLists.txt +++ b/ports/cmake/src/libmpg123/CMakeLists.txt @@ -235,6 +235,13 @@ else() target_sources(${TARGET} PRIVATE ${PLATFORM_SOURCES}) endif() +if(HAVE_M) + string(APPEND LIBMPG123_LIBS " -lm") +endif() +if(WANT_WIN32_UNICODE) + string(APPEND LIBMPG123_LIBS " -lshlwapi") +endif() +set(LIBMPG123_LIBS "${LIBMPG123_LIBS}" PARENT_SCOPE) target_link_libraries(${TARGET} PRIVATE $<$:m> $<$:shlwapi>) diff --git a/ports/cmake/src/libout123/CMakeLists.txt b/ports/cmake/src/libout123/CMakeLists.txt index d0fe358..7ff1f8c 100644 --- a/ports/cmake/src/libout123/CMakeLists.txt +++ b/ports/cmake/src/libout123/CMakeLists.txt @@ -18,9 +18,24 @@ add_library(${TARGET} set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME out123) +if(HAVE_UNIX_DL) + string(APPEND LIBOUT123_LIBS " -ldl") +endif() +if(HAVE_M) + string(APPEND LIBOUT123_LIBS " -lm") +endif() +if(HAVE_RT) + string(APPEND LIBOUT123_LIBS " -lrt") +endif() +if(WANT_WIN32_UNICODE) + string(APPEND LIBOUT123_LIBS " -lshlwapi") +endif() +set(LIBOUT123_LIBS "${LIBOUT123_LIBS}" PARENT_SCOPE) target_link_libraries(${TARGET} PRIVATE $ $<$:dl> + $<$:m> + $<$:rt> $<$:shlwapi>) target_include_directories(${TARGET} INTERFACE diff --git a/ports/cmake/src/libsyn123/CMakeLists.txt b/ports/cmake/src/libsyn123/CMakeLists.txt index 6edb5b7..22051ab 100644 --- a/ports/cmake/src/libsyn123/CMakeLists.txt +++ b/ports/cmake/src/libsyn123/CMakeLists.txt @@ -19,9 +19,12 @@ target_include_directories(${TARGET} INTERFACE "$" "$") +if(HAVE_M) + string(APPEND LIBSYN123_LIBS " -lm") +endif() +set(LIBSYN123_LIBS "${LIBSYN123_LIBS}" PARENT_SCOPE) target_link_libraries(${TARGET} PRIVATE - $<$:m> - $<$:shlwapi>) + $<$:m>) install(TARGETS ${TARGET} EXPORT targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/" diff --git a/scripts/tag_lyrics.py b/scripts/tag_lyrics.py index 1feb081..567ac28 100644 --- a/scripts/tag_lyrics.py +++ b/scripts/tag_lyrics.py @@ -20,10 +20,10 @@ TEXT_DESC = '' # get workdir from first arg or use current dir if (len(sys.argv) > 1): fname = sys.argv[1] - print "fname=" + fname + print("fname=" + fname) else: - print 'Give me at least a file name to work on, plus the lyrics from stdin' - print 'Optionally, you can provide the language (3 lowercase letters) of the lyrics and a description' + print('Give me at least a file name to work on, plus the lyrics from stdin') + print('Optionally, you can provide the language (3 lowercase letters) of the lyrics and a description') sys.exit() if (len(sys.argv) > 2): @@ -32,7 +32,7 @@ if (len(sys.argv) > 2): if (len(sys.argv) > 3): TEXT_DESC = sys.argv[3] -print "reading lyrics from standard input ..." +print("reading lyrics from standard input ...") lyrics = sys.stdin.read().strip() @@ -41,25 +41,25 @@ for enc in ('utf8','iso-8859-1','iso-8859-15','cp1252','cp1251','latin1'): try: lyrics = lyrics.decode(enc) TEXT_DESC = TEXT_DESC.decode(enc) - print enc, + print(enc, end=" ") break except: pass -print "Adding lyrics to " + fname -print "Language: " + TEXT_LANG -print "Description: " + TEXT_DESC +print("Adding lyrics to " + fname) +print("Language: " + TEXT_LANG) +print("Description: " + TEXT_DESC) # create ID3 tag if not exists try: tags = ID3(fname) except ID3NoHeaderError: - print "Adding ID3 header;", + print("Adding ID3 header;", end=" ") tags = ID3() # remove old unsychronized lyrics if len(tags.getall(u"USLT::'"+TEXT_LANG+"'")) != 0: - print "Removing Lyrics." + print("Removing Lyrics.") tags.delall(u"USLT::'"+TEXT_LANG+"'") #tags.save(fname) # hm, why? @@ -68,9 +68,9 @@ if len(tags.getall(u"USLT::'"+TEXT_LANG+"'")) != 0: # USLT frames are present #tags[u"USLT::'eng'"] = (USLT(encoding=3, lang=u'eng', desc=u'desc', text=lyrics)) tags[u"USLT::'"+TEXT_LANG+"'"] = (USLT(encoding=3, lang=TEXT_LANG, desc=TEXT_DESC, text=lyrics)) -print 'Added USLT frame to', fname +print('Added USLT frame to', fname) tags.save(fname) -print 'Done' +print('Done') diff --git a/src/libmpg123/format.c b/src/libmpg123/format.c index 5350ed4..c4457e3 100644 --- a/src/libmpg123/format.c +++ b/src/libmpg123/format.c @@ -688,7 +688,7 @@ static void conv_s16_to_s32(struct outbuffer *buf) #include "../common/swap_bytes_impl.h" -void swap_endian(struct outbuffer *buf, int block) +static void swap_endian(struct outbuffer *buf, int block) { size_t count; diff --git a/src/libmpg123/id3.c b/src/libmpg123/id3.c index 180f489..0bd5cda 100644 --- a/src/libmpg123/id3.c +++ b/src/libmpg123/id3.c @@ -794,7 +794,7 @@ static int promote_framename(mpg123_handle *fr, char *id) /* fr because of VERBO #endif /* NO_ID3V2 */ -int store_id3v2( mpg123_handle *fr +static int store_id3v2( mpg123_handle *fr , unsigned long first4bytes, unsigned char buf[6], unsigned long length ) { int ret = 1; diff --git a/src/libmpg123/mpg123lib_intern.h b/src/libmpg123/mpg123lib_intern.h index b46c419..7cd5504 100644 --- a/src/libmpg123/mpg123lib_intern.h +++ b/src/libmpg123/mpg123lib_intern.h @@ -21,7 +21,10 @@ // Only portable API plays a role in the library itself, outside of lfs_wrap.c. // Also, we need to ensure no suffix renaming for the primary implementations. -#define MPG123_PORTABLE_API +// But: The _definition_ of non-portable API needs to be present for those +// primary implementations being exported for DLL builds. Just the largefile +// renaming needs to be skipped! +#define MPG123_NO_LARGENAME #define MPG123_ENUM_API #include "mpg123.h" diff --git a/src/libmpg123/optimize.c b/src/libmpg123/optimize.c index 00e43c1..65c5a77 100644 --- a/src/libmpg123/optimize.c +++ b/src/libmpg123/optimize.c @@ -1027,7 +1027,7 @@ static const char *mpg123_decoder_list[] = NULL }; -void check_decoders(void) +static void check_decoders(void) { #ifndef OPT_MULTI /* In non-multi mode, only the full list (one entry) is used. */ diff --git a/src/libout123/libout123.c b/src/libout123/libout123.c index 44dd52b..f3155da 100644 --- a/src/libout123/libout123.c +++ b/src/libout123/libout123.c @@ -1,7 +1,7 @@ /* audio: audio output interface - copyright ?-2023 by the mpg123 project - free software under the terms of the LGPL 2.1 + copyright ?-2024 by the mpg123 project - free software under the terms of the LGPL 2.1 see COPYING and AUTHORS files in distribution or http://mpg123.org initially written by Michael Hipp */ @@ -455,11 +455,12 @@ out123_open(out123_handle *ao, const char* driver, const char* device) } /* Now loop over the list of possible modules to find one that works. */ - nextname = strtok(modnames, ","); + char *toksave = NULL; + nextname = strtok_r(modnames, ",", &toksave); while(!ao->open && nextname) { char *curname = nextname; - nextname = strtok(NULL, ","); + nextname = strtok_r(NULL, ",", &toksave); check_output_module(ao, curname, device, !nextname); if(ao->open) { diff --git a/src/libout123/modules/sndio.c b/src/libout123/modules/sndio.c index 726d266..5dce4e5 100644 --- a/src/libout123/modules/sndio.c +++ b/src/libout123/modules/sndio.c @@ -129,7 +129,8 @@ static int open_sndio(out123_handle *ao) hdl = sio_open(ao->device /* NULL is fine */, SIO_PLAY, 0); if (hdl == NULL) { - error("Got nothing from sio_open(). "); + if(!AOQUIET) + error("Got nothing from sio_open(). "); return -1; } @@ -152,7 +153,8 @@ static int open_sndio(out123_handle *ao) hdl = sio_open(ao->device, SIO_PLAY, 0); if(hdl == NULL) { - error("Re-opening of device for channel guessing failed."); + if(!AOQUIET) + error("Re-opening of device for channel guessing failed."); return -1; } par.pchan = guess_channels(hdl); diff --git a/src/version.h b/src/version.h index 7356ed9..610cf56 100644 --- a/src/version.h +++ b/src/version.h @@ -16,7 +16,7 @@ // only single spaces as separator to ease parsing by build scripts #define MPG123_MAJOR 1 #define MPG123_MINOR 32 -#define MPG123_PATCH 9 +#define MPG123_PATCH 10 // Don't get too wild with that to avoid confusing m4. No brackets. // Also, it should fit well into a sane file name for the tarball. #define MPG123_SUFFIX ""