mpg123-1.32.10

This commit is contained in:
Ozkan Sezer
2024-12-15 10:28:28 +03:00
parent fc1ca4a8f9
commit 22dadfaa3c
15 changed files with 89 additions and 35 deletions

11
NEWS
View File

@@ -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 1.32.9
------ ------
- libmpg123: - libmpg123:

20
configure vendored
View File

@@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # 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 <maintainer@mpg123.org>. # Report bugs to <maintainer@mpg123.org>.
# #
@@ -621,8 +621,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='mpg123' PACKAGE_NAME='mpg123'
PACKAGE_TARNAME='mpg123' PACKAGE_TARNAME='mpg123'
PACKAGE_VERSION='1.32.9' PACKAGE_VERSION='1.32.10'
PACKAGE_STRING='mpg123 1.32.9' PACKAGE_STRING='mpg123 1.32.10'
PACKAGE_BUGREPORT='maintainer@mpg123.org' PACKAGE_BUGREPORT='maintainer@mpg123.org'
PACKAGE_URL='' 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. # 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. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF 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]... Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1798,7 +1798,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of mpg123 1.32.9:";; short | recursive ) echo "Configuration of mpg123 1.32.10:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@@ -2076,7 +2076,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
mpg123 configure 1.32.9 mpg123 configure 1.32.10
generated by GNU Autoconf 2.71 generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc. Copyright (C) 2021 Free Software Foundation, Inc.
@@ -2621,7 +2621,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. 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 generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw $ $0$ac_configure_args_raw
@@ -3991,7 +3991,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='mpg123' PACKAGE='mpg123'
VERSION='1.32.9' VERSION='1.32.10'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h 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 # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" 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 generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES 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 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped' ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\ ac_cs_version="\\
mpg123 config.status 1.32.9 mpg123 config.status 1.32.10
configured by $0, generated by GNU Autoconf 2.71, configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"

View File

@@ -3,7 +3,7 @@
# - devel packages for alsa, sdl, etc... to build the respective output modules. # - devel packages for alsa, sdl, etc... to build the respective output modules.
Summary: The fast console mpeg audio decoder/player. Summary: The fast console mpeg audio decoder/player.
Name: mpg123 Name: mpg123
Version: 1.32.9 Version: 1.32.10
Release: 1 Release: 1
URL: http://www.mpg123.org/ URL: http://www.mpg123.org/
License: GPL License: GPL

View File

@@ -41,6 +41,14 @@ function(check_m)
check_function_exists(sin HAVE_M) check_function_exists(sin HAVE_M)
endfunction(check_m) endfunction(check_m)
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(atoll HAVE_ATOLL)
check_function_exists(getaddrinfo HAVE_IPV6) check_function_exists(getaddrinfo HAVE_IPV6)
@@ -450,3 +458,7 @@ if(UNIX AND NOT PORTABLE_API)
endif() endif()
configure_file(config.cmake.h.in config.h) 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)

View File

@@ -235,6 +235,13 @@ else()
target_sources(${TARGET} PRIVATE ${PLATFORM_SOURCES}) target_sources(${TARGET} PRIVATE ${PLATFORM_SOURCES})
endif() 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 target_link_libraries(${TARGET} PRIVATE
$<$<BOOL:${HAVE_M}>:m> $<$<BOOL:${HAVE_M}>:m>
$<$<BOOL:${WANT_WIN32_UNICODE}>:shlwapi>) $<$<BOOL:${WANT_WIN32_UNICODE}>:shlwapi>)

View File

@@ -18,9 +18,24 @@ add_library(${TARGET}
set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME out123) 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 target_link_libraries(${TARGET} PRIVATE
$<TARGET_NAME_IF_EXISTS:defaultmodule> $<TARGET_NAME_IF_EXISTS:defaultmodule>
$<$<BOOL:${HAVE_UNIX_DL}>:dl> $<$<BOOL:${HAVE_UNIX_DL}>:dl>
$<$<BOOL:${HAVE_M}>:m>
$<$<BOOL:${HAVE_RT}>:rt>
$<$<BOOL:${WANT_WIN32_UNICODE}>:shlwapi>) $<$<BOOL:${WANT_WIN32_UNICODE}>:shlwapi>)
target_include_directories(${TARGET} INTERFACE target_include_directories(${TARGET} INTERFACE

View File

@@ -19,9 +19,12 @@ target_include_directories(${TARGET} INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>" "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>") "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
if(HAVE_M)
string(APPEND LIBSYN123_LIBS " -lm")
endif()
set(LIBSYN123_LIBS "${LIBSYN123_LIBS}" PARENT_SCOPE)
target_link_libraries(${TARGET} PRIVATE target_link_libraries(${TARGET} PRIVATE
$<$<BOOL:${HAVE_M}>:m> $<$<BOOL:${HAVE_M}>:m>)
$<$<BOOL:${WANT_WIN32_UNICODE}>:shlwapi>)
install(TARGETS ${TARGET} EXPORT targets install(TARGETS ${TARGET} EXPORT targets
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/"

View File

@@ -20,10 +20,10 @@ TEXT_DESC = ''
# get workdir from first arg or use current dir # get workdir from first arg or use current dir
if (len(sys.argv) > 1): if (len(sys.argv) > 1):
fname = sys.argv[1] fname = sys.argv[1]
print "fname=" + fname print("fname=" + fname)
else: else:
print 'Give me at least a file name to work on, plus the lyrics from stdin' 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('Optionally, you can provide the language (3 lowercase letters) of the lyrics and a description')
sys.exit() sys.exit()
if (len(sys.argv) > 2): if (len(sys.argv) > 2):
@@ -32,7 +32,7 @@ if (len(sys.argv) > 2):
if (len(sys.argv) > 3): if (len(sys.argv) > 3):
TEXT_DESC = 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() lyrics = sys.stdin.read().strip()
@@ -41,25 +41,25 @@ for enc in ('utf8','iso-8859-1','iso-8859-15','cp1252','cp1251','latin1'):
try: try:
lyrics = lyrics.decode(enc) lyrics = lyrics.decode(enc)
TEXT_DESC = TEXT_DESC.decode(enc) TEXT_DESC = TEXT_DESC.decode(enc)
print enc, print(enc, end=" ")
break break
except: except:
pass pass
print "Adding lyrics to " + fname print("Adding lyrics to " + fname)
print "Language: " + TEXT_LANG print("Language: " + TEXT_LANG)
print "Description: " + TEXT_DESC print("Description: " + TEXT_DESC)
# create ID3 tag if not exists # create ID3 tag if not exists
try: try:
tags = ID3(fname) tags = ID3(fname)
except ID3NoHeaderError: except ID3NoHeaderError:
print "Adding ID3 header;", print("Adding ID3 header;", end=" ")
tags = ID3() tags = ID3()
# remove old unsychronized lyrics # remove old unsychronized lyrics
if len(tags.getall(u"USLT::'"+TEXT_LANG+"'")) != 0: if len(tags.getall(u"USLT::'"+TEXT_LANG+"'")) != 0:
print "Removing Lyrics." print("Removing Lyrics.")
tags.delall(u"USLT::'"+TEXT_LANG+"'") tags.delall(u"USLT::'"+TEXT_LANG+"'")
#tags.save(fname) # hm, why? #tags.save(fname) # hm, why?
@@ -68,9 +68,9 @@ if len(tags.getall(u"USLT::'"+TEXT_LANG+"'")) != 0:
# USLT frames are present # USLT frames are present
#tags[u"USLT::'eng'"] = (USLT(encoding=3, lang=u'eng', desc=u'desc', text=lyrics)) #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)) 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) tags.save(fname)
print 'Done' print('Done')

View File

@@ -688,7 +688,7 @@ static void conv_s16_to_s32(struct outbuffer *buf)
#include "../common/swap_bytes_impl.h" #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; size_t count;

View File

@@ -794,7 +794,7 @@ static int promote_framename(mpg123_handle *fr, char *id) /* fr because of VERBO
#endif /* NO_ID3V2 */ #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 ) , unsigned long first4bytes, unsigned char buf[6], unsigned long length )
{ {
int ret = 1; int ret = 1;

View File

@@ -21,7 +21,10 @@
// Only portable API plays a role in the library itself, outside of lfs_wrap.c. // 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. // 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 #define MPG123_ENUM_API
#include "mpg123.h" #include "mpg123.h"

View File

@@ -1027,7 +1027,7 @@ static const char *mpg123_decoder_list[] =
NULL NULL
}; };
void check_decoders(void) static void check_decoders(void)
{ {
#ifndef OPT_MULTI #ifndef OPT_MULTI
/* In non-multi mode, only the full list (one entry) is used. */ /* In non-multi mode, only the full list (one entry) is used. */

View File

@@ -1,7 +1,7 @@
/* /*
audio: audio output interface 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 see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Michael Hipp 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. */ /* 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) while(!ao->open && nextname)
{ {
char *curname = nextname; char *curname = nextname;
nextname = strtok(NULL, ","); nextname = strtok_r(NULL, ",", &toksave);
check_output_module(ao, curname, device, !nextname); check_output_module(ao, curname, device, !nextname);
if(ao->open) if(ao->open)
{ {

View File

@@ -129,7 +129,8 @@ static int open_sndio(out123_handle *ao)
hdl = sio_open(ao->device /* NULL is fine */, SIO_PLAY, 0); hdl = sio_open(ao->device /* NULL is fine */, SIO_PLAY, 0);
if (hdl == NULL) if (hdl == NULL)
{ {
error("Got nothing from sio_open(). "); if(!AOQUIET)
error("Got nothing from sio_open(). ");
return -1; return -1;
} }
@@ -152,7 +153,8 @@ static int open_sndio(out123_handle *ao)
hdl = sio_open(ao->device, SIO_PLAY, 0); hdl = sio_open(ao->device, SIO_PLAY, 0);
if(hdl == NULL) 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; return -1;
} }
par.pchan = guess_channels(hdl); par.pchan = guess_channels(hdl);

View File

@@ -16,7 +16,7 @@
// only single spaces as separator to ease parsing by build scripts // only single spaces as separator to ease parsing by build scripts
#define MPG123_MAJOR 1 #define MPG123_MAJOR 1
#define MPG123_MINOR 32 #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. // 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. // Also, it should fit well into a sane file name for the tarball.
#define MPG123_SUFFIX "" #define MPG123_SUFFIX ""