diff -Nru squeezelite-1.9.9-1395+git20220104.874e4f9/alpine/APKBUILD squeezelite-1.9.9-1414+git20221121.dbe69eb/alpine/APKBUILD --- squeezelite-1.9.9-1395+git20220104.874e4f9/alpine/APKBUILD 2022-01-05 16:34:10.000000000 +0000 +++ squeezelite-1.9.9-1414+git20221121.dbe69eb/alpine/APKBUILD 2022-11-21 15:41:11.000000000 +0000 @@ -1,15 +1,15 @@ # Contributor: Carl Chave # Maintainer: Ralph Irving pkgname=squeezelite -pkgver=1.9.7.1273 -pkgrel=1 +pkgver=1.9.9.1401 +pkgrel=0 pkgdesc="Lightweight headless squeezebox player for Logitech Media Server" url="https://github.com/ralph-irving/squeezelite" arch="all" license="GPL-3.0-or-later3" options="!check" # No test suite -depends="flac alsa-lib faad2 mpg123 libvorbis libmad soxr openssl opusfile libalac" -makedepends="flac-dev alsa-lib-dev faad2-dev mpg123-dev libvorbis-dev libmad-dev soxr-dev openssl-dev opusfile-dev opus-dev libalac-dev" +depends="flac alsa-lib faad2-libs mpg123-libs libvorbis libmad soxr openssl opusfile libalac lirc" +makedepends="flac-dev alsa-lib-dev faad2-dev mpg123-dev libvorbis-dev libmad-dev soxr-dev openssl-dev opusfile-dev opus-dev libalac-dev lirc-dev" install="$pkgname.pre-install" subpackages="$pkgname-doc $pkgname-openrc" source="$pkgname-$pkgver.zip::https://github.com/ralph-irving/squeezelite/archive/master.zip load-libtremor-first.patch $pkgname.confd $pkgname.initd" @@ -17,7 +17,7 @@ build() { cd "$builddir" - make OPTS="-DRESAMPLE -DDSD -DGPIO -DVISEXPORT -DUSE_SSL -DNO_SSLSYM -DOPUS -DALAC -I/usr/include/opus -I/usr/include/alac" + make OPTS="-DRESAMPLE -DDSD -DGPIO -DVISEXPORT -DUSE_SSL -DNO_SSLSYM -DOPUS -DALAC -DIR -I/usr/include/opus -I/usr/include/alac" gcc -Os -fomit-frame-pointer -fcommon -s -o find_servers tools/find_servers.c gcc -Os -fomit-frame-pointer -fcommon -s -o alsacap tools/alsacap.c -lasound } diff -Nru squeezelite-1.9.9-1395+git20220104.874e4f9/alpine/libalac/APKBUILD squeezelite-1.9.9-1414+git20221121.dbe69eb/alpine/libalac/APKBUILD --- squeezelite-1.9.9-1395+git20220104.874e4f9/alpine/libalac/APKBUILD 2022-01-05 16:34:10.000000000 +0000 +++ squeezelite-1.9.9-1414+git20221121.dbe69eb/alpine/libalac/APKBUILD 2022-11-21 15:41:11.000000000 +0000 @@ -45,5 +45,5 @@ install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/COPYING } -sha512sums="e72b13714476170108844b84c0043dc06d2ff2e8c9b651a7ad1571d148fc5567aca48048646d16fb82630d6972a31b9328f04e522972b297d1cf8e804785867f fix-arm-segfault.patch +sha512sums="271d4c5184c7f48ac79c8f8f9f3bc39f7f970b4d98acda792e40450b687f211094b4dcaea23e034d4deb7ea78713b95e691db9c09fbf31b1be59b6d525ef11a8 fix-arm-segfault.patch 093379f79b5dc9f5b8aa45826d61738b088d78305a7d514df33851ae34d02ee9034a8ecddf2558fcb1bf4daaf64c620ea4411521908cfc748e31fd0a2d50bbf7 alac-version.patch" diff -Nru squeezelite-1.9.9-1395+git20220104.874e4f9/alpine/squeezelite.initd squeezelite-1.9.9-1414+git20221121.dbe69eb/alpine/squeezelite.initd --- squeezelite-1.9.9-1395+git20220104.874e4f9/alpine/squeezelite.initd 2022-01-05 16:34:10.000000000 +0000 +++ squeezelite-1.9.9-1414+git20221121.dbe69eb/alpine/squeezelite.initd 2022-11-21 15:41:11.000000000 +0000 @@ -4,7 +4,7 @@ depend() { need net - use alsasound + use alsa after bootmisc } diff -Nru squeezelite-1.9.9-1395+git20220104.874e4f9/debian/changelog squeezelite-1.9.9-1414+git20221121.dbe69eb/debian/changelog --- squeezelite-1.9.9-1395+git20220104.874e4f9/debian/changelog 2022-11-28 16:30:24.000000000 +0000 +++ squeezelite-1.9.9-1414+git20221121.dbe69eb/debian/changelog 2022-12-11 00:19:57.000000000 +0000 @@ -1,14 +1,9 @@ -squeezelite (1.9.9-1395+git20220104.874e4f9-1build2) lunar; urgency=medium +squeezelite (1.9.9-1414+git20221121.dbe69eb-1) unstable; urgency=medium - * No-change rebuild against libflac++10 & libflac12. + * New upstream version 1.9.9-1414+git20221121.dbe69eb + * Enable -DOPUS and add build-dep on libopus-dev and libopusfile-dev - -- Rik Mills Mon, 28 Nov 2022 16:30:24 +0000 - -squeezelite (1.9.9-1395+git20220104.874e4f9-1build1) kinetic; urgency=medium - - * No-change rebuild against libavcodec59 - - -- Steve Langasek Tue, 19 Jul 2022 13:08:02 +0000 + -- tony mancill Sat, 10 Dec 2022 16:19:57 -0800 squeezelite (1.9.9-1395+git20220104.874e4f9-1) unstable; urgency=medium diff -Nru squeezelite-1.9.9-1395+git20220104.874e4f9/debian/control squeezelite-1.9.9-1414+git20221121.dbe69eb/debian/control --- squeezelite-1.9.9-1395+git20220104.874e4f9/debian/control 2022-07-19 13:08:02.000000000 +0000 +++ squeezelite-1.9.9-1414+git20221121.dbe69eb/debian/control 2022-12-11 00:19:57.000000000 +0000 @@ -1,8 +1,7 @@ Source: squeezelite Section: sound Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Chris Boot +Maintainer: Chris Boot Uploaders: tony mancill Build-Depends: debhelper-compat (= 13), @@ -13,6 +12,8 @@ liblircclient-dev, libmad0-dev, libmpg123-dev, + libopus-dev, + libopusfile-dev, libpulse-dev, libsoxr-dev, libssl-dev, diff -Nru squeezelite-1.9.9-1395+git20220104.874e4f9/debian/rules squeezelite-1.9.9-1414+git20221121.dbe69eb/debian/rules --- squeezelite-1.9.9-1395+git20220104.874e4f9/debian/rules 2022-01-09 17:13:26.000000000 +0000 +++ squeezelite-1.9.9-1414+git20221121.dbe69eb/debian/rules 2022-12-11 00:19:57.000000000 +0000 @@ -4,9 +4,9 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -# Enable ffmpeg, soxr resampling, visualisation export and disable dlopening -# libraries -export OPTS := -DDSD -DFFMPEG -DRESAMPLE -DVISEXPORT -DLINKALL -DIR -DUSE_SSL +# Enable ffmpeg, sox resampling, visualisation export, opus, +# and disable dlopening libraries +export OPTS := -DDSD -DFFMPEG -DRESAMPLE -DVISEXPORT -DLINKALL -DIR -DUSE_SSL -DOPUS -I/usr/include/opus # Enable all hardening build flags export DEB_BUILD_MAINT_OPTIONS := hardening=+all diff -Nru squeezelite-1.9.9-1395+git20220104.874e4f9/debian/watch squeezelite-1.9.9-1414+git20221121.dbe69eb/debian/watch --- squeezelite-1.9.9-1395+git20220104.874e4f9/debian/watch 2022-01-09 17:13:26.000000000 +0000 +++ squeezelite-1.9.9-1414+git20221121.dbe69eb/debian/watch 2022-12-11 00:19:57.000000000 +0000 @@ -1,6 +1,6 @@ version=4 # debian/watch -# Disabled because upstream does not want to apply tags. See requests: +# Upstream does not apply tags. See requests: # - https://github.com/ralph-irving/squeezelite/issues/29 # - https://github.com/ralph-irving/squeezelite/issues/55 # - https://github.com/ralph-irving/squeezelite/issues/63 @@ -9,5 +9,10 @@ # Upstream repo: # https://github.com/ralph-irving/squeezelite # -# The orig.tar.gz is created using `git archive` - for example: -# git archive --format=tgz --prefix=squeezelite-1.9+git2021216.e02fa87/ --output=../squeezelite_1.9+git20201216.e02fa87.orig.tar.gz e02fa87128debc65e26c582f1a017a20a53d1bcf +# The orig.tar.gz is created using `git archive` against the upstream repo - for example: +# git archive --format=tgz --prefix=squeezelite-1.9.9-1414+git20221121.dbe69eb/ --output=../squeezelite_1.9.9-1414+git20221121.dbe69eb.orig.tar.gz dbe69eb8aa88f644cfb46541d6cef72fa666570d +# +# the major, minor, and micro versions are taken from https://github.com/ralph-irving/squeezelite/blob/master/squeezelite.h + +opts="mode=git,pgpmode=none,pretty=1.9.9-xxxx+git%cd.%h" \ + https://github.com/ralph-irving/squeezelite heads/master debian diff -Nru squeezelite-1.9.9-1395+git20220104.874e4f9/decode.c squeezelite-1.9.9-1414+git20221121.dbe69eb/decode.c --- squeezelite-1.9.9-1395+git20220104.874e4f9/decode.c 2022-01-05 16:34:10.000000000 +0000 +++ squeezelite-1.9.9-1414+git20221121.dbe69eb/decode.c 2022-11-21 15:41:11.000000000 +0000 @@ -183,6 +183,7 @@ if (!strstr(exclude_codecs, "pcm") && (!include_codecs || (order_codecs = strstr(include_codecs, "pcm")))) sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_pcm()); +#if !defined(NO_MAD) && !defined(NO_MPG123) // try mad then mpg for mp3 unless command line option passed if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mad")) && (!include_codecs || (order_codecs = strstr(include_codecs, "mp3")) || (order_codecs = strstr(include_codecs, "mad")))) @@ -190,6 +191,13 @@ else if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mpg")) && (!include_codecs || (order_codecs = strstr(include_codecs, "mp3")) || (order_codecs = strstr(include_codecs, "mpg")))) sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_mpg()); +#elif !defined(NO_MAD) + if (!strstr(exclude_codecs, "mp3") && (!include_codecs || (order_codecs = strstr(include_codecs, "mp3")))) + sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_mad()); +#elif !defined(NO_MPG123) + if (!strstr(exclude_codecs, "mp3") && (!include_codecs || (order_codecs = strstr(include_codecs, "mp3")))) + sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_mpg()); +#endif LOG_DEBUG("include codecs: %s exclude codecs: %s", include_codecs ? include_codecs : "", exclude_codecs); diff -Nru squeezelite-1.9.9-1395+git20220104.874e4f9/ffmpeg.c squeezelite-1.9.9-1414+git20221121.dbe69eb/ffmpeg.c --- squeezelite-1.9.9-1395+git20220104.874e4f9/ffmpeg.c 2022-01-05 16:34:10.000000000 +0000 +++ squeezelite-1.9.9-1414+git20221121.dbe69eb/ffmpeg.c 2022-11-21 15:41:11.000000000 +0000 @@ -752,7 +752,7 @@ static struct codec ret = { 'w', // id - "wma,wmap", // types + "wma,wmap,wmal", // types READ_SIZE, // min read WRITE_SIZE, // min space ff_open_wma, // open @@ -760,7 +760,7 @@ ff_decode, // decode }; - LOG_INFO("using ffmpeg to decode wma,wmap"); + LOG_INFO("using ffmpeg to decode wma,wmap,wmal"); return &ret; } diff -Nru squeezelite-1.9.9-1395+git20220104.874e4f9/flac.c squeezelite-1.9.9-1414+git20221121.dbe69eb/flac.c --- squeezelite-1.9.9-1395+git20220104.874e4f9/flac.c 2022-01-05 16:34:10.000000000 +0000 +++ squeezelite-1.9.9-1414+git20221121.dbe69eb/flac.c 2022-11-21 15:41:11.000000000 +0000 @@ -282,9 +282,14 @@ static bool load_flac() { #if !LINKALL - void *handle = dlopen(LIBFLAC, RTLD_NOW); + void *handle = NULL; + char name[30]; char *err; + sprintf(name, LIBFLAC, FLAC_API_VERSION_CURRENT < 12 ? 8 : 12); + + handle = dlopen(name, RTLD_NOW); + if (!handle) { LOG_INFO("dlerror: %s", dlerror()); return false; @@ -305,7 +310,7 @@ return false; } - LOG_INFO("loaded "LIBFLAC); + LOG_INFO("loaded %s", name); #endif return true; diff -Nru squeezelite-1.9.9-1395+git20220104.874e4f9/main.c squeezelite-1.9.9-1414+git20221121.dbe69eb/main.c --- squeezelite-1.9.9-1395+git20220104.874e4f9/main.c 2022-01-05 16:34:10.000000000 +0000 +++ squeezelite-1.9.9-1414+git20221121.dbe69eb/main.c 2022-11-21 15:41:11.000000000 +0000 @@ -28,7 +28,7 @@ #define TITLE "Squeezelite " VERSION ", Copyright 2012-2015 Adrian Smith, 2015-2021 Ralph Irving." -#define CODECS_BASE "flac,pcm,mp3,ogg" +#define CODECS_BASE "flac,pcm,ogg" #if NO_FAAD #define CODECS_AAC "" #else @@ -51,7 +51,13 @@ #else #define CODECS_DSD "" #endif -#define CODECS_MP3 " (mad,mpg for specific mp3 codec)" +#if !defined(NO_MAD) && !defined(NO_MPG123) +#define CODECS_MP3 ",mp3 (mad,mpg for specific mp3 codec)" +#elif defined(NO_MAD) && defined(NO_MPG123) +#define CODECS_MP3 "" +#else +#define CODECS_MP3 ",mp3" +#endif #define CODECS CODECS_BASE CODECS_AAC CODECS_FF CODECS_OPUS CODECS_DSD CODECS_MP3 @@ -221,6 +227,12 @@ #if NO_SSLSYM " NO_SSLSYM" #endif +#if NO_MPG123 + " NO_MPG123" +#endif +#if NO_MAD + " NO_MAD" +#endif #if LINKALL " LINKALL" #endif diff -Nru squeezelite-1.9.9-1395+git20220104.874e4f9/Makefile squeezelite-1.9.9-1414+git20221121.dbe69eb/Makefile --- squeezelite-1.9.9-1395+git20220104.874e4f9/Makefile 2022-01-05 16:34:10.000000000 +0000 +++ squeezelite-1.9.9-1414+git20221121.dbe69eb/Makefile 2022-11-21 15:41:11.000000000 +0000 @@ -5,26 +5,28 @@ EXECUTABLE ?= squeezelite # passing one or more of these in $(OPTS) enables optional feature inclusion -OPT_DSD = -DDSD -OPT_FF = -DFFMPEG -OPT_ALAC = -DALAC -OPT_LINKALL = -DLINKALL -OPT_RESAMPLE= -DRESAMPLE -OPT_VIS = -DVISEXPORT -OPT_IR = -DIR -OPT_GPIO = -DGPIO -OPT_RPI = -DRPI -OPT_NO_FAAD = -DNO_FAAD -OPT_SSL = -DUSE_SSL -OPT_NOSSLSYM= -DNO_SSLSYM -OPT_OPUS = -DOPUS -OPT_PORTAUDIO = -DPORTAUDIO +OPT_DSD = -DDSD +OPT_FF = -DFFMPEG +OPT_ALAC = -DALAC +OPT_LINKALL = -DLINKALL +OPT_RESAMPLE = -DRESAMPLE +OPT_VIS = -DVISEXPORT +OPT_IR = -DIR +OPT_GPIO = -DGPIO +OPT_RPI = -DRPI +OPT_NO_FAAD = -DNO_FAAD +OPT_NO_MAD = -DNO_MAD +OPT_NO_MPG123 = -DNO_MPG123 +OPT_SSL = -DUSE_SSL +OPT_NOSSLSYM = -DNO_SSLSYM +OPT_OPUS = -DOPUS +OPT_PORTAUDIO = -DPORTAUDIO OPT_PULSEAUDIO = -DPULSEAUDIO SOURCES = \ main.c slimproto.c buffer.c stream.c utils.c \ output.c output_alsa.c output_pa.c output_stdout.c output_pack.c output_pulse.c decode.c \ - flac.c pcm.c mad.c vorbis.c mpg.c + flac.c pcm.c vorbis.c SOURCES_DSD = dsd.c dop.c dsd2pcm/dsd2pcm.c SOURCES_FF = ffmpeg.c @@ -37,6 +39,8 @@ SOURCES_FAAD = faad.c SOURCES_SSL = sslsym.c SOURCES_OPUS = opus.c +SOURCES_MAD = mad.c +SOURCES_MPG123 = mpg.c LINK_LINUX = -ldl LINK_ALSA = -lasound @@ -45,12 +49,14 @@ LINK_SSL = -lssl -lcrypto LINK_ALAC = -lalac -LINKALL = -lmad -lmpg123 -lFLAC -lvorbisfile -lvorbis -logg +LINKALL = -lFLAC -lvorbisfile -lvorbis -logg LINKALL_FF = -lavformat -lavcodec -lavutil LINKALL_RESAMPLE = -lsoxr LINKALL_IR = -llirc_client LINKALL_FAAD = -lfaad LINKALL_OPUS = -lopusfile -lopus +LINKALL_MAD = -lmad +LINKALL_MPG123 = -lmpg123 DEPS = squeezelite.h slimproto.h @@ -98,6 +104,12 @@ ifneq (,$(findstring $(OPT_SSL), $(OPTS))) SOURCES += $(SOURCES_SSL) endif +ifeq (,$(findstring $(OPT_NO_MAD), $(OPTS))) + SOURCES += $(SOURCES_MAD) +endif +ifeq (,$(findstring $(OPT_NO_MPG123), $(OPTS))) + SOURCES += $(SOURCES_MPG123) +endif # add optional link options ifneq (,$(findstring $(OPT_LINKALL), $(OPTS))) @@ -120,6 +132,12 @@ ifneq (,$(findstring $(OPT_SSL), $(OPTS))) LDADD += $(LINK_SSL) endif +ifeq (,$(findstring $(OPT_NO_MAD), $(OPTS))) + LDADD += $(LINKALL_MAD) +endif +ifeq (,$(findstring $(OPT_NO_MPG123), $(OPTS))) + LDADD += $(LINKALL_MPG123) +endif else # if not LINKALL and linux add LINK_LINUX ifeq ($(UNAME), Linux) diff -Nru squeezelite-1.9.9-1395+git20220104.874e4f9/opus.c squeezelite-1.9.9-1414+git20221121.dbe69eb/opus.c --- squeezelite-1.9.9-1395+git20220104.874e4f9/opus.c 2022-01-05 16:34:10.000000000 +0000 +++ squeezelite-1.9.9-1414+git20221121.dbe69eb/opus.c 2022-11-21 15:41:11.000000000 +0000 @@ -45,6 +45,7 @@ struct opus { struct OggOpusFile *of; + bool end; #if FRAME_BUF u8_t *write_buf; #endif @@ -119,7 +120,7 @@ LOCK_S; - if (stream.state <= DISCONNECT && !_buf_used(streambuf)) { + if (stream.state <= DISCONNECT && u->end) { UNLOCK_S; return DECODE_COMPLETE; } @@ -171,6 +172,8 @@ frames = process.max_in_frames; write_buf = process.inbuf; ); + + u->end = frames == 0; // write the decoded frames into outputbuf then unpack them (they are 16 bits) n = OP(u, read, u->of, (opus_int16*) write_buf, frames * channels, NULL); @@ -273,6 +276,7 @@ free(u->write_buf); u->write_buf = NULL; #endif + u->end = false; } static bool load_opus(void) { diff -Nru squeezelite-1.9.9-1395+git20220104.874e4f9/squeezelite.h squeezelite-1.9.9-1414+git20221121.dbe69eb/squeezelite.h --- squeezelite-1.9.9-1395+git20220104.874e4f9/squeezelite.h 2022-01-05 16:34:10.000000000 +0000 +++ squeezelite-1.9.9-1414+git20221121.dbe69eb/squeezelite.h 2022-11-21 15:41:11.000000000 +0000 @@ -26,7 +26,7 @@ #define MAJOR_VERSION "1.9" #define MINOR_VERSION "9" -#define MICRO_VERSION "1395" +#define MICRO_VERSION "1414" #if defined(CUSTOM_VERSION) #define VERSION "v" MAJOR_VERSION "." MINOR_VERSION "-" MICRO_VERSION STR(CUSTOM_VERSION) @@ -190,7 +190,7 @@ // dynamically loaded libraries at run time #if LINUX -#define LIBFLAC "libFLAC.so.8" +#define LIBFLAC "libFLAC.so.%d" #define LIBMAD "libmad.so.0" #define LIBMPG "libmpg123.so.0" #define LIBVORBIS "libvorbisfile.so.3" @@ -205,7 +205,7 @@ #endif #if OSX -#define LIBFLAC "libFLAC.8.dylib" +#define LIBFLAC "libFLAC.%d.dylib" #define LIBMAD "libmad.0.dylib" #define LIBMPG "libmpg123.0.dylib" #define LIBVORBIS "libvorbisfile.3.dylib" @@ -233,7 +233,7 @@ #endif #if FREEBSD -#define LIBFLAC "libFLAC.so.8" +#define LIBFLAC "libFLAC.so.%d" #define LIBMAD "libmad.so.0" #define LIBMPG "libmpg123.so.0" #define LIBVORBIS "libvorbisfile.so.3" diff -Nru squeezelite-1.9.9-1395+git20220104.874e4f9/stream.c squeezelite-1.9.9-1414+git20221121.dbe69eb/stream.c --- squeezelite-1.9.9-1395+git20220104.874e4f9/stream.c 2022-01-05 16:34:10.000000000 +0000 +++ squeezelite-1.9.9-1414+git20221121.dbe69eb/stream.c 2022-11-21 15:41:11.000000000 +0000 @@ -51,8 +51,12 @@ struct streamstate stream; #if USE_SSL +#if WIN +#define _last_error() WSAGetLastError() +#define ERROR_WOULDBLOCK WSAEWOULDBLOCK +#else #define _last_error() ERROR_WOULDBLOCK - +#endif static SSL_CTX *SSLctx; SSL *ssl; @@ -393,6 +397,7 @@ // stream body into streambuf } else { int n; + int error; space = min(_buf_space(streambuf), _buf_cont_write(streambuf)); if (stream.meta_interval) { @@ -404,9 +409,12 @@ LOG_INFO("end of stream (%u bytes)", stream.bytes); _disconnect(DISCONNECT, DISCONNECT_OK); } - if (n < 0 && _last_error() != ERROR_WOULDBLOCK) { - LOG_INFO("error reading: %s", strerror(last_error())); - _disconnect(DISCONNECT, REMOTE_DISCONNECT); + if (n < 0) { + error = _last_error(); + if (error != ERROR_WOULDBLOCK) { + LOG_INFO("error reading: %s (%d)", strerror(error), error); + _disconnect(DISCONNECT, REMOTE_DISCONNECT); + } } if (n > 0) { diff -Nru squeezelite-1.9.9-1395+git20220104.874e4f9/vorbis.c squeezelite-1.9.9-1414+git20221121.dbe69eb/vorbis.c --- squeezelite-1.9.9-1395+git20220104.874e4f9/vorbis.c 2022-01-05 16:34:10.000000000 +0000 +++ squeezelite-1.9.9-1414+git20221121.dbe69eb/vorbis.c 2022-11-21 15:41:11.000000000 +0000 @@ -54,7 +54,7 @@ struct vorbis { OggVorbis_File *vf; - bool opened; + bool opened, end; #if FRAME_BUF u8_t *write_buf; #endif @@ -140,7 +140,7 @@ LOCK_S; - if (stream.state <= DISCONNECT && !_buf_used(streambuf)) { + if (stream.state <= DISCONNECT && v->end) { UNLOCK_S; return DECODE_COMPLETE; } @@ -204,6 +204,7 @@ ); bytes = frames * 2 * channels; // samples returned are 16 bits + v->end = frames == 0; // write the decoded frames into outputbuf even though they are 16 bits per sample, then unpack them #ifdef TREMOR_ONLY @@ -311,6 +312,7 @@ v->opened = false; } } + v->end = false; } static void vorbis_close(void) {