Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package mpg123 for openSUSE:Factory checked in at 2023-03-22 22:29:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mpg123 (Old) and /work/SRC/openSUSE:Factory/.mpg123.new.31432 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mpg123" Wed Mar 22 22:29:01 2023 rev:34 rq:1073078 version:1.31.3 Changes: -------- --- /work/SRC/openSUSE:Factory/mpg123/mpg123.changes 2023-01-16 17:57:47.314441004 +0100 +++ /work/SRC/openSUSE:Factory/.mpg123.new.31432/mpg123.changes 2023-03-22 22:29:02.681710977 +0100 @@ -1,0 +2,15 @@ +Mon Mar 20 09:37:10 UTC 2023 - Luigi Baldoni <aloi...@gmx.com> + +- Update to version 1.31.3 + build: + * Fix --disable-8bit. + * Fix some pedantic compiler warnings, avoid breaking libtool + wrappers. + mpg123: + * Fix verbose position printout for new resampling outside + libmpg123 (where output rate differs from decoding rate). + libsyn123: + * Fix reconfiguration of resampler to avoid double free when + reducing decimator stages to zero. + +------------------------------------------------------------------- Old: ---- mpg123-1.31.2.tar.bz2 mpg123-1.31.2.tar.bz2.sig New: ---- mpg123-1.31.3.tar.bz2 mpg123-1.31.3.tar.bz2.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mpg123.spec ++++++ --- /var/tmp/diff_new_pack.gCT5ec/_old 2023-03-22 22:29:03.161713393 +0100 +++ /var/tmp/diff_new_pack.gCT5ec/_new 2023-03-22 22:29:03.169713433 +0100 @@ -18,7 +18,7 @@ %define sover 0 Name: mpg123 -Version: 1.31.2 +Version: 1.31.3 Release: 0 Summary: Console MPEG audio player and decoder library License: LGPL-2.1-only ++++++ mpg123-1.31.2.tar.bz2 -> mpg123-1.31.3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/NEWS new/mpg123-1.31.3/NEWS --- old/mpg123-1.31.2/NEWS 2023-01-14 23:41:35.000000000 +0100 +++ new/mpg123-1.31.3/NEWS 2023-03-15 10:03:59.000000000 +0100 @@ -1,3 +1,17 @@ +1.31.3 +------ +- build: +-- Fix --disable-8bit. +-- Fall back to generic decoder if no yasm for MSVC (bug 346). +-- Fix some pedantic compiler warnings, avoid breaking libtool wrappers. +- mpg123: +-- Fix verbose position printout for new resampling outside libmpg123 (where + output rate differs from decoding rate). +- libsyn123: +-- Fix reconfiguration of resampler to avoid double free when reducing + decimator stages to zero (bug 350). Thanks to Youngseok Choi for reporting + this fuzzed issue. + 1.31.2 ------ - Fix build --with-network=internal only (configure logic error, bug 348). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/configure new/mpg123-1.31.3/configure --- old/mpg123-1.31.2/configure 2023-01-14 23:44:09.000000000 +0100 +++ new/mpg123-1.31.3/configure 2023-03-17 18:10:31.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for mpg123 1.31.2. +# Generated by GNU Autoconf 2.69 for mpg123 1.31.3. # # Report bugs to <maintai...@mpg123.org>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='mpg123' PACKAGE_TARNAME='mpg123' -PACKAGE_VERSION='1.31.2' -PACKAGE_STRING='mpg123 1.31.2' +PACKAGE_VERSION='1.31.3' +PACKAGE_STRING='mpg123 1.31.3' PACKAGE_BUGREPORT='maintai...@mpg123.org' PACKAGE_URL='' @@ -1687,7 +1687,7 @@ # 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.31.2 to adapt to many kinds of systems. +\`configure' configures mpg123 1.31.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1758,7 +1758,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of mpg123 1.31.2:";; + short | recursive ) echo "Configuration of mpg123 1.31.3:";; esac cat <<\_ACEOF @@ -1999,7 +1999,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -mpg123 configure 1.31.2 +mpg123 configure 1.31.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2605,7 +2605,7 @@ 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.31.2, which was +It was created by mpg123 $as_me 1.31.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2961,7 +2961,7 @@ OUTLIB_PATCHLEVEL=7 SYNAPI_VERSION=1 -SYNLIB_PATCHLEVEL=4 +SYNLIB_PATCHLEVEL=5 LIBMPG123_VERSION=$API_VERSION:$LIB_PATCHLEVEL:$API_VERSION LIBOUT123_VERSION=$OUTAPI_VERSION:$OUTLIB_PATCHLEVEL:$OUTAPI_VERSION @@ -3564,7 +3564,7 @@ # Define the identity of the package. PACKAGE='mpg123' - VERSION='1.31.2' + VERSION='1.31.3' cat >>confdefs.h <<_ACEOF @@ -15069,7 +15069,7 @@ fi - if test "x$int16" = "xenabled"; then + if test "x$int8" = "xenabled"; then HAVE_SYNTH8_TRUE= HAVE_SYNTH8_FALSE='#' else @@ -20754,7 +20754,7 @@ # 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.31.2, which was +This file was extended by mpg123 $as_me 1.31.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20820,7 +20820,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -mpg123 config.status 1.31.2 +mpg123 config.status 1.31.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/configure.ac new/mpg123-1.31.3/configure.ac --- old/mpg123-1.31.2/configure.ac 2023-01-14 23:41:35.000000000 +0100 +++ new/mpg123-1.31.3/configure.ac 2023-03-17 18:10:06.000000000 +0100 @@ -9,7 +9,7 @@ AC_PREREQ([2.69]) dnl ############# Initialisation -AC_INIT([mpg123], [1.31.2], [maintai...@mpg123.org]) +AC_INIT([mpg123], [1.31.3], [maintai...@mpg123.org]) dnl Increment API_VERSION when the API gets changes (new functions). dnl libmpg123 @@ -22,7 +22,7 @@ dnl libsyn123 SYNAPI_VERSION=1 -SYNLIB_PATCHLEVEL=4 +SYNLIB_PATCHLEVEL=5 dnl Since we want to be backwards compatible, both sides get set to API_VERSION. LIBMPG123_VERSION=$API_VERSION:$LIB_PATCHLEVEL:$API_VERSION @@ -900,7 +900,7 @@ AC_DEFINE(NO_8BIT, 1, [ Define to disable 8 bit integer output. ]) fi -AM_CONDITIONAL([HAVE_SYNTH8], [test "x$int16" = "xenabled"]) +AM_CONDITIONAL([HAVE_SYNTH8], [test "x$int8" = "xenabled"]) if test "x$int32" = "xdisabled"; then AC_DEFINE(NO_32BIT, 1, [ Define to disable 32 bit and 24 bit integer output. ]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/mpg123.spec new/mpg123-1.31.3/mpg123.spec --- old/mpg123-1.31.2/mpg123.spec 2023-01-14 23:45:30.000000000 +0100 +++ new/mpg123-1.31.3/mpg123.spec 2023-03-19 12:20:58.000000000 +0100 @@ -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.31.2 +Version: 1.31.3 Release: 1 URL: http://www.mpg123.org/ License: GPL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/ports/cmake/src/libmpg123/CMakeLists.txt new/mpg123-1.31.3/ports/cmake/src/libmpg123/CMakeLists.txt --- old/mpg123-1.31.2/ports/cmake/src/libmpg123/CMakeLists.txt 2023-01-14 23:41:36.000000000 +0100 +++ new/mpg123-1.31.3/ports/cmake/src/libmpg123/CMakeLists.txt 2023-03-15 09:12:03.000000000 +0100 @@ -71,6 +71,19 @@ "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/$<$<BOOL:${LFS_SENSITIVE}>:lfs_wrap.c>" $<TARGET_OBJECTS:compat>) +if(MSVC) + if(MACHINE MATCHES "x86|amd64") + find_program(YASM_ASSEMBLER yasm) + if(NOT YASM_ASSEMBLER) + message(WARNING "Couldn't find yasm assembler for optimizded decoders. Please set YASM_ASSEMBLER variable") + set(MACHINE generic) + endif() + else() + message(WARNING "Need work to support non-x86 assembly optimizations with MSVC.") + set(MACHINE generic) + endif() +endif() + if(MACHINE STREQUAL "amd64") if(HAVE_FPU) set(PLATFORM_DEFINITIONS OPT_MULTI OPT_X86_64 OPT_AVX OPT_GENERIC OPT_GENERIC_DITHER) @@ -135,10 +148,6 @@ "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/dct64_i386.c") endif() elseif(MACHINE STREQUAL "arm64") - if(MSVC) - set(PLATFORM_DEFINITIONS OPT_GENERIC) - message(WARNING "Cannot use platform-specific assembly sources on MSVC") - else() set(PLATFORM_DEFINITIONS OPT_MULTI OPT_GENERIC OPT_GENERIC_DITHER OPT_NEON64) set(PLATFORM_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/dct36_neon64.S" @@ -160,13 +169,8 @@ target_sources(${TARGET} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/dither.c" "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/getcpuflags_arm.c") - endif() elseif(MACHINE STREQUAL "arm32") if(HAVE_FPU) - if(MSVC) - set(PLATFORM_DEFINITIONS OPT_GENERIC) - message(WARNING "Cannot use platform-specific assembly sources on MSVC") - else() set(PLATFORM_DEFINITIONS OPT_MULTI OPT_GENERIC OPT_GENERIC_DITHER OPT_NEON) set(PLATFORM_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/dct36_neon.S" @@ -191,12 +195,7 @@ target_sources(${TARGET} PRIVATE ${PLATFORM_SOURCES}) target_sources(${TARGET} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/dither.c") - endif() else() - if(MSVC) - set(PLATFORM_DEFINITIONS OPT_GENERIC) - message(WARNING "Cannot use platform-specific assembly sources on MSVC") - else() set(PLATFORM_DEFINITIONS OPT_ARM) if(ACCURATE_ROUNDING) set(PLATFORM_SOURCES @@ -206,7 +205,6 @@ "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/synth_arm.S") endif() target_sources(${TARGET} PRIVATE ${PLATFORM_SOURCES}) - endif() endif() elseif(MACHINE STREQUAL "generic") set(PLATFORM_DEFINITIONS OPT_GENERIC) @@ -222,11 +220,7 @@ $<$<BOOL:${HAVE_FPU}>:REAL_IS_FLOAT> $<$<NOT:$<BOOL:${HAVE_FPU}>>:REAL_IS_FIXED>) -if(MSVC AND MACHINE MATCHES "x86|amd64") - find_program(YASM_ASSEMBLER yasm) - if(NOT YASM_ASSEMBLER) - message(FATAL_ERROR "Couldn't find yasm assembler. Please set YASM_ASSEMBLER variable") - endif() +if(MSVC AND MACHINE MATCHES "x86|amd64" AND YASM_ASSEMBLER) list(TRANSFORM PLATFORM_DEFINITIONS PREPEND /D) foreach(FILE ${PLATFORM_SOURCES}) get_filename_component(FILENAME ${FILE} NAME) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/src/common.c new/mpg123-1.31.3/src/common.c --- old/mpg123-1.31.2/src/common.c 2023-01-14 23:41:36.000000000 +0100 +++ new/mpg123-1.31.3/src/common.c 2023-03-15 09:29:04.000000000 +0100 @@ -171,14 +171,15 @@ static int old_term_width = -1; size_t buffered; off_t decoded; - off_t elapsed; - off_t remain; - off_t length; + double elapsed; + double remain; + double length; off_t frame; off_t frames; off_t rframes; int spf; double basevol, realvol; + long inrate; long rate; int framesize; struct mpg123_frameinfo mi; @@ -186,7 +187,7 @@ char *line = NULL; #ifndef __OS2__ -#ifndef WIN32 +#ifndef _WIN32 #ifndef GENERIC /* Only generate new stat line when stderr is ready... don't overfill... */ { @@ -204,11 +205,13 @@ #endif #endif #endif + if(mpg123_getformat(fr, &inrate, NULL, NULL)) + return; if(out123_getformat(ao, &rate, NULL, NULL, &framesize)) return; buffered = out123_buffered(ao)/framesize; decoded = mpg123_tell(fr); - length = mpg123_length(fr); + length = (double)mpg123_length(fr)/inrate; frame = mpg123_tellframe(fr); frames = mpg123_framelength(fr); spf = mpg123_spf(fr); @@ -222,7 +225,7 @@ Buffering makes the relationships between the numbers non-trivial. */ rframes = frames-frame; // May be negative, a countdown. Buffer only confuses in paused (looping) mode, though. - elapsed = decoded + offset*spf - (paused ? 0 : buffered); + elapsed = (double)(decoded + offset*spf)/inrate - (double)(paused ? 0 : buffered)/rate; remain = elapsed > 0 ? length - elapsed : length; if( MPG123_OK == mpg123_info(fr, &mi) && MPG123_OK == mpg123_getvolume(fr, &basevol, &realvol, NULL) ) @@ -263,8 +266,8 @@ ? malloc(linelen+1) /* Only malloc if it is a really long line. */ : linebuf; /* Small buffer on stack is enough. */ - tim[0] = (double)elapsed/rate; - tim[1] = (double)remain/rate; + tim[0] = elapsed; + tim[1] = remain; tim[2] = (double)buffered/rate; for(ti=0; ti<3; ++ti) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/src/compat/compat.c new/mpg123-1.31.3/src/compat/compat.c --- old/mpg123-1.31.2/src/compat/compat.c 2023-01-14 23:41:36.000000000 +0100 +++ new/mpg123-1.31.3/src/compat/compat.c 2023-03-15 09:22:06.000000000 +0100 @@ -179,6 +179,10 @@ it late to some official APIs, that's still fine with us. */ +#ifdef WANT_WIN32_UNICODE +typedef HRESULT (__stdcall *PCA_ptr)( const wchar_t *, const wchar_t*, unsigned long, wchar_t **); +#endif + char* compat_catpath(const char *prefix, const char* path) { char *ret = NULL; @@ -193,8 +197,7 @@ ThOr: I presume this hack is for supporting pre-8 Windows, as from Windows 8 on, this is documented in the API. */ - HRESULT (__stdcall *mypac)( const wchar_t *in, const wchar_t* more - , unsigned long flags, wchar_t **out ) = NULL; + PCA_ptr mypac = NULL; HMODULE pathcch = NULL; if(!prefix && !path) @@ -207,7 +210,7 @@ /* Again: I presume this whole fun is to get at PathAllocCombine even when pathcch.h is not available (like in MinGW32). */ if( (pathcch = GetModuleHandleA("kernelbase")) ) - mypac = (void *)GetProcAddress(pathcch, "PathAllocCombine"); + mypac = (PCA_ptr) GetProcAddress(pathcch, "PathAllocCombine"); if(mypac) /* PATHCCH_ALLOW_LONG_PATH = 1 per API docs */ { debug("Actually calling PathAllocCombine!"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/src/compat/compat_dl.c new/mpg123-1.31.3/src/compat/compat_dl.c --- old/mpg123-1.31.2/src/compat/compat_dl.c 2023-01-14 23:41:36.000000000 +0100 +++ new/mpg123-1.31.3/src/compat/compat_dl.c 2023-03-15 09:20:01.000000000 +0100 @@ -12,6 +12,8 @@ #include "config.h" /* This source file does need _POSIX_SOURCE to get some sigaction. */ #define _POSIX_SOURCE +/* Fix pedantic error about w2upath being unused */ +#define HIDE_w2upath #include "compat.h" #ifdef _MSC_VER @@ -87,7 +89,7 @@ if(!handle) return NULL; #ifdef WANT_WIN32_UNICODE - sym = GetProcAddress(handle, name); + sym = (void *)(uintptr_t)GetProcAddress(handle, name); #else sym = dlsym(handle, name); #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/src/compat/wpathconv.h new/mpg123-1.31.3/src/compat/wpathconv.h --- old/mpg123-1.31.2/src/compat/wpathconv.h 2023-01-14 23:41:36.000000000 +0100 +++ new/mpg123-1.31.3/src/compat/wpathconv.h 2023-03-15 09:20:01.000000000 +0100 @@ -26,6 +26,7 @@ return wpath; } +#ifndef HIDE_w2upath /* Convert Windows wide character paths to unix UTF-8. */ static char* w2upath(const wchar_t *wpath) { @@ -37,6 +38,7 @@ *p = '/'; return upath; } +#endif /* An absolute path that is too long and not already marked with \\?\ can be marked as a long one and still work. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/src/control_generic.c new/mpg123-1.31.3/src/control_generic.c --- old/mpg123-1.31.2/src/control_generic.c 2023-01-14 23:41:36.000000000 +0100 +++ new/mpg123-1.31.3/src/control_generic.c 2023-03-15 09:20:01.000000000 +0100 @@ -26,7 +26,7 @@ #include "out123.h" #include <stdarg.h> #include <ctype.h> -#if !defined (WIN32) || defined (__CYGWIN__) +#if !defined (_WIN32) || defined (__CYGWIN__) #include <sys/wait.h> #include <sys/socket.h> #endif @@ -397,7 +397,7 @@ outstream = stdout; out_is_term = stdout_is_term; } -#ifndef WIN32 +#ifndef _WIN32 setlinebuf(outstream); #else /* perhaps just use setvbuf as it's C89 */ /* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/src/libmpg123/layer3.c new/mpg123-1.31.3/src/libmpg123/layer3.c --- old/mpg123-1.31.2/src/libmpg123/layer3.c 2023-01-14 23:41:36.000000000 +0100 +++ new/mpg123-1.31.3/src/libmpg123/layer3.c 2023-03-15 09:21:51.000000000 +0100 @@ -499,7 +499,10 @@ static int III_dequantize_sample(mpg123_handle *fr, real xr[SBLIMIT][SSLIMIT],int *scf, struct gr_info_s *gr_info,int sfreq,int part2bits) { int shift = 1 + gr_info->scalefac_scale; - real *xrpnt = (real *) xr; + // Pointer cast to make pedantic compilers happy. + real *xrpnt = (real*)xr; + // Some compiler freaks out over &xr[SBLIMIT][0], which is the same. + real *xrpntlimit = (real*)xr+SBLIMIT*SSLIMIT; int l[3],l3; int part2remain = gr_info->part2_3_length - part2bits; const short *me; @@ -552,10 +555,10 @@ } } -#define CHECK_XRPNT if(xrpnt >= &xr[SBLIMIT][0]) \ +#define CHECK_XRPNT if(xrpnt >= xrpntlimit) \ { \ if(NOQUIET) \ - error2("attempted xrpnt overflow (%p !< %p)", (void*) xrpnt, (void*) &xr[SBLIMIT][0]); \ + error2("attempted xrpnt overflow (%p !< %p)", (void*) xrpnt, (void*) xrpntlimit); \ return 1; \ } @@ -992,7 +995,7 @@ gr_info->maxb = 1; } - while(xrpnt < &xr[SBLIMIT][0]) + while(xrpnt < xrpntlimit) *xrpnt++ = DOUBLE_TO_REAL(0.0); while( part2remain > 16 ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/src/libout123/modules/win32.c new/mpg123-1.31.3/src/libout123/modules/win32.c --- old/mpg123-1.31.2/src/libout123/modules/win32.c 2023-01-14 23:41:36.000000000 +0100 +++ new/mpg123-1.31.3/src/libout123/modules/win32.c 2023-03-15 09:20:01.000000000 +0100 @@ -169,11 +169,10 @@ static int get_formats_win32(out123_handle *ao) { WAVEOUTCAPSA caps; - MMRESULT mr; int ret = 0; UINT dev_id = dev_select(ao); - mr = waveOutGetDevCaps(dev_id, &caps, sizeof(caps)); + MMRESULT mr = waveOutGetDevCaps(dev_id, &caps, sizeof(caps)); if(mr != MMSYSERR_NOERROR) return 0; /* no formats? */ @@ -369,6 +368,21 @@ memset(id, 0, sizeof(id)); memset(&caps, 0, sizeof(caps)); mr = waveOutGetDevCaps(i, &caps, sizeof(caps)); + if (mr != MMSYSERR_NOERROR) { + switch(mr) { + case MMSYSERR_BADDEVICEID: + error("enumerate_win32: Specified device identifier is out of range."); + break; + case MMSYSERR_NODRIVER: + error("enumerate_win32: No device driver is present."); + break; + case MMSYSERR_NOMEM: + error("enumerate_win32: Unable to allocate or lock memory."); + break; + default: + merror("enumerate_win32: Uknown error 0x%x.", mr); + } + } mdebug("waveOutGetDevCaps mr %x", mr); snprintf(id, sizeof(id) - 1, "%u", i); store_device(devlist, id, caps.szPname); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/src/libout123/modules/win32_wasapi.c new/mpg123-1.31.3/src/libout123/modules/win32_wasapi.c --- old/mpg123-1.31.2/src/libout123/modules/win32_wasapi.c 2023-01-14 23:41:36.000000000 +0100 +++ new/mpg123-1.31.3/src/libout123/modules/win32_wasapi.c 2023-03-15 09:20:01.000000000 +0100 @@ -518,7 +518,6 @@ static int enumerate_win32( out123_handle *ao, int (*store_device)(void *devlist , const char *name, const char *description), void *devlist ) { - int len; char *pszID = NULL, *pszDesc = NULL; HRESULT hr = S_OK; UINT pcDevices = 0, i = 0; @@ -614,6 +613,7 @@ ao->close = close_win32; ao->userptr = NULL; ao->enumerate = enumerate_win32; + ao->deinit = deinit_win32; /* Success */ return 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/src/libsyn123/resample.c new/mpg123-1.31.3/src/libsyn123/resample.c --- old/mpg123-1.31.2/src/libsyn123/resample.c 2023-01-14 23:41:36.000000000 +0100 +++ new/mpg123-1.31.3/src/libsyn123/resample.c 2023-03-15 09:30:12.000000000 +0100 @@ -2377,24 +2377,31 @@ } rd->stage_history = sth; } - struct decimator_state *nd = safe_realloc( rd->decim - , sizeof(*rd->decim)*decim_stages ); - struct lpf4_hist *ndh = safe_realloc( rd->decim_hist - , sizeof(*rd->decim_hist)*decim_stages*channels ); - if(nd) - rd->decim = nd; - if(ndh) - rd->decim_hist = ndh; - if(!nd || !ndh) + if(decim_stages) { - perror("cannot allocate decimator state"); - err = SYN123_DOOM; - goto setup_resample_cleanup; + struct decimator_state *nd = safe_realloc( rd->decim + , sizeof(*rd->decim)*decim_stages ); + struct lpf4_hist *ndh = safe_realloc( rd->decim_hist + , sizeof(*rd->decim_hist)*decim_stages*channels ); + if(nd) + rd->decim = nd; + if(ndh) + rd->decim_hist = ndh; + if(!nd || !ndh) + { + perror("cannot allocate decimator state"); + err = SYN123_DOOM; + goto setup_resample_cleanup; + } + } else + { + free(rd->decim); rd->decim = NULL; + free(rd->decim_hist); rd->decim_hist = NULL; } // Link up the common memory blocks after each realloc. for(unsigned int dc=0; dc<decim_stages; ++dc) { - rd->decim[dc].ch = ndh+dc*channels; + rd->decim[dc].ch = rd->decim_hist+dc*channels; rd->decim[dc].out_hist = rd->stage_history ? rd->stage_history+(dc+1)*STAGE_HISTORY*channels : NULL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/src/mpg123app.h new/mpg123-1.31.3/src/mpg123app.h --- old/mpg123-1.31.2/src/mpg123app.h 2023-01-14 23:41:36.000000000 +0100 +++ new/mpg123-1.31.3/src/mpg123app.h 2023-03-15 09:20:01.000000000 +0100 @@ -18,7 +18,7 @@ /* import DLL symbols on windows */ #include "httpget.h" -#if WIN32 +#if _WIN32 #include "win32_support.h" #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/src/net123_winhttp.c new/mpg123-1.31.3/src/net123_winhttp.c --- old/mpg123-1.31.2/src/net123_winhttp.c 2023-01-14 23:41:36.000000000 +0100 +++ new/mpg123-1.31.3/src/net123_winhttp.c 2023-03-15 09:20:01.000000000 +0100 @@ -53,6 +53,7 @@ ret = WinHttpSetCredentials(nh->request, WINHTTP_AUTH_TARGET_SERVER, mode, nh->comps.lpszUserName, nh->comps.lpszPassword, NULL); return GetLastError(); } + return TRUE; } #if DEBUG @@ -95,6 +96,7 @@ DWORD headerlen; const LPCWSTR useragent = MPG123WSTR(PACKAGE_NAME) L"/" MPG123WSTR(PACKAGE_VERSION); WINHTTP_STATUS_CALLBACK cb; + net123_handle *handle = NULL; if(!WinHttpCheckPlatform()) return NULL; @@ -105,7 +107,7 @@ winhttp_handle *ret = calloc(1, sizeof(winhttp_handle)); if (!ret) goto cleanup; - net123_handle *handle = calloc(1, sizeof(net123_handle)); + handle = calloc(1, sizeof(net123_handle)); if (!handle) { free(ret); goto cleanup; @@ -178,7 +180,7 @@ if (!res) { res = GetLastError(); - error1("WinHttpSendRequest failed with %lu", res); + error1("WinHttpSendRequest failed with %d", res); if(res == ERROR_WINHTTP_SECURE_FAILURE){ res = *(DWORD *)ret->additionalInfo; error("Additionally, the ERROR_WINHTTP_SECURE_FAILURE failed with:"); @@ -221,8 +223,10 @@ cleanup: debug("net123_open error"); if (urlW) free(urlW); - net123_close(handle); - handle = NULL; + if (handle) { + net123_close(handle); + handle = NULL; + } return handle; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/src/net123_wininet.c new/mpg123-1.31.3/src/net123_wininet.c --- old/mpg123-1.31.2/src/net123_wininet.c 2023-01-14 23:41:36.000000000 +0100 +++ new/mpg123-1.31.3/src/net123_wininet.c 2023-03-15 09:21:37.000000000 +0100 @@ -73,13 +73,14 @@ size_t ii; WINBOOL res; DWORD headerlen; + net123_handle *ret = NULL; const LPCWSTR useragent = MPG123WSTR(PACKAGE_NAME) L"/" MPG123WSTR(PACKAGE_VERSION); INTERNET_STATUS_CALLBACK cb; win32_utf8_wide(url, &urlW, NULL); if(urlW == NULL) goto cleanup; - net123_handle *ret = calloc(1, sizeof(net123_handle)); + ret = calloc(1, sizeof(net123_handle)); wininet_handle *wh = calloc(1, sizeof(wininet_handle)); if(!ret || !wh) { @@ -158,7 +159,7 @@ if (!res) { res = GetLastError(); - error1("HttpSendRequestW failed with %lu", res); + error1("HttpSendRequestW failed with %d", res); goto cleanup; } debug("HttpSendRequestW OK"); @@ -196,8 +197,10 @@ cleanup: debug("net123_open error"); if (urlW) free(urlW); - net123_close(ret); - ret = NULL; + if(ret) { + net123_close(ret); + ret = NULL; + } return ret; } @@ -219,7 +222,7 @@ /* is this needed? */ to_copy = bufsize > ULONG_MAX ? ULONG_MAX : bufsize; if(!InternetReadFile(wh->request, buf, to_copy, &bytesread)){ - error1("InternetReadFile exited with %d", GetLastError()); + error1("InternetReadFile exited with %ld", GetLastError()); return EOF; } return bytesread; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/src/out123.c new/mpg123-1.31.3/src/out123.c --- old/mpg123-1.31.2/src/out123.c 2023-01-14 23:41:36.000000000 +0100 +++ new/mpg123-1.31.3/src/out123.c 2023-03-15 09:20:02.000000000 +0100 @@ -30,10 +30,10 @@ #include "config.h" #include "compat.h" #include <ctype.h> -#if WIN32 +#if _WIN32 #include "win32_support.h" #endif -#if defined(WIN32) && defined(DYNAMIC_BUILD) +#if defined(_WIN32) && defined(DYNAMIC_BUILD) #define LINK_MPG123_DLL #endif #include "out123.h" @@ -108,7 +108,9 @@ #ifdef HAVE_WINDOWS_H static int w32_priority = 0; #endif +#ifdef HAVE_SETPRIORITY static int aggressive = FALSE; +#endif static double preload = 0.2; static long outflags = 0; double preamp = 0.; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/src/term_win32.c new/mpg123-1.31.3/src/term_win32.c --- old/mpg123-1.31.2/src/term_win32.c 2023-01-14 23:41:36.000000000 +0100 +++ new/mpg123-1.31.3/src/term_win32.c 2023-03-15 09:19:52.000000000 +0100 @@ -29,7 +29,7 @@ static HANDLE consoleintput = INVALID_HANDLE_VALUE; static HANDLE consoleoutput = INVALID_HANDLE_VALUE; static HANDLE getconsoleintput(void){ - DWORD mode, r; + DWORD mode; if(consoleintput == INVALID_HANDLE_VALUE){ consoleintput = CreateFileW(L"CONIN$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); if(consoleintput == INVALID_HANDLE_VALUE || consoleintput == NULL) @@ -55,7 +55,6 @@ return 0; } -static DWORD lastmode; int term_setup(void) { return 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpg123-1.31.2/src/win32_net.c new/mpg123-1.31.3/src/win32_net.c --- old/mpg123-1.31.2/src/win32_net.c 2023-01-14 23:41:36.000000000 +0100 +++ new/mpg123-1.31.3/src/win32_net.c 2023-03-15 09:19:45.000000000 +0100 @@ -99,6 +99,7 @@ return ret; } +/* static int get_sock_ch (int sock) { char c; @@ -108,6 +109,7 @@ return (((int) c)&0xff); return -1; } +*/ ssize_t win32_net_write (int fildes, const void *buf, size_t nbyte) {