Hello community, here is the log from the commit of package opusfile for openSUSE:Factory checked in at 2016-09-08 17:38:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/opusfile (Old) and /work/SRC/openSUSE:Factory/.opusfile.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "opusfile" Changes: -------- --- /work/SRC/openSUSE:Factory/opusfile/opusfile.changes 2016-01-08 15:24:11.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.opusfile.new/opusfile.changes 2016-09-08 17:38:52.000000000 +0200 @@ -1,0 +2,8 @@ +Thu Sep 1 16:06:33 UTC 2016 - zai...@opensuse.org + +- Update to version 0.8: + + Add support for OpenSSL 1.1.x. + + Fix issues with tag parsing introduced in v0.7. + + Fix skip logic for multiplexed non-Opus data. + +------------------------------------------------------------------- Old: ---- opusfile-0.7.tar.gz New: ---- opusfile-0.8.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ opusfile.spec ++++++ --- /var/tmp/diff_new_pack.7VzUCq/_old 2016-09-08 17:38:53.000000000 +0200 +++ /var/tmp/diff_new_pack.7VzUCq/_new 2016-09-08 17:38:53.000000000 +0200 @@ -18,7 +18,7 @@ Name: opusfile -Version: 0.7 +Version: 0.8 Release: 0 %define soname 0 Summary: A high-level API for decoding and seeking within .opus files ++++++ opusfile-0.7.tar.gz -> opusfile-0.8.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opusfile-0.7/Makefile.in new/opusfile-0.8/Makefile.in --- old/opusfile-0.7/Makefile.in 2016-01-05 01:35:20.000000000 +0100 +++ new/opusfile-0.8/Makefile.in 2016-07-06 19:38:02.000000000 +0200 @@ -987,9 +987,9 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@HAVE_DOXYGEN_FALSE@install-data-local: -@HAVE_DOXYGEN_FALSE@clean-local: @HAVE_DOXYGEN_FALSE@uninstall-local: +@HAVE_DOXYGEN_FALSE@clean-local: +@HAVE_DOXYGEN_FALSE@install-data-local: clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opusfile-0.7/aclocal.m4 new/opusfile-0.8/aclocal.m4 --- old/opusfile-0.7/aclocal.m4 2016-01-05 01:35:18.000000000 +0100 +++ new/opusfile-0.8/aclocal.m4 2016-07-06 19:38:02.000000000 +0200 @@ -20,32 +20,63 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 1 (pkg-config-0.24) -# -# Copyright © 2004 Scott James Remnant <sc...@netsplit.com>. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- +dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +dnl serial 11 (pkg-config-0.29) +dnl +dnl Copyright © 2004 Scott James Remnant <sc...@netsplit.com>. +dnl Copyright © 2012-2015 Dan Nicholson <dbn.li...@gmail.com> +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. +dnl +dnl As a special exception to the GNU General Public License, if you +dnl distribute this file as part of a program that contains a +dnl configuration script generated by Autoconf, you may include it under +dnl the same distribution terms that you use for the rest of that +dnl program. + +dnl PKG_PREREQ(MIN-VERSION) +dnl ----------------------- +dnl Since: 0.29 +dnl +dnl Verify that the version of the pkg-config macros are at least +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's +dnl installed version of pkg-config, this checks the developer's version +dnl of pkg.m4 when generating configure. +dnl +dnl To ensure that this macro is defined, also add: +dnl m4_ifndef([PKG_PREREQ], +dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) +dnl +dnl See the "Since" comment for each macro you use to see what version +dnl of the macros you require. +m4_defun([PKG_PREREQ], +[m4_define([PKG_MACROS_VERSION], [0.29]) +m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, + [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) +])dnl PKG_PREREQ + +dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) +dnl ---------------------------------- +dnl Since: 0.16 +dnl +dnl Search for the pkg-config tool and set the PKG_CONFIG variable to +dnl first found in the path. Checks that the version of pkg-config found +dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is +dnl used since that's the first version where most current features of +dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) @@ -67,18 +98,19 @@ PKG_CONFIG="" fi fi[]dnl -])# PKG_PROG_PKG_CONFIG +])dnl PKG_PROG_PKG_CONFIG -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -# only at the first occurence in configure.ac, so if the first place -# it's called might be skipped (such as if it is within an "if", you -# have to call PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- +dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------------------------------- +dnl Since: 0.18 +dnl +dnl Check to see whether a particular set of modules exists. Similar to +dnl PKG_CHECK_MODULES(), but does not set variables or print errors. +dnl +dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +dnl only at the first occurence in configure.ac, so if the first place +dnl it's called might be skipped (such as if it is within an "if", you +dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ @@ -88,8 +120,10 @@ $3])dnl fi]) -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- +dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +dnl --------------------------------------------- +dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting +dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" @@ -101,10 +135,11 @@ else pkg_failed=untried fi[]dnl -])# _PKG_CONFIG +])dnl _PKG_CONFIG -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- +dnl _PKG_SHORT_ERRORS_SUPPORTED +dnl --------------------------- +dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -112,19 +147,17 @@ else _pkg_short_errors_supported=no fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED +])dnl _PKG_SHORT_ERRORS_SUPPORTED -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- +dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl -------------------------------------------------------------- +dnl Since: 0.4.0 +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES might not happen, you should be sure to include an +dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl @@ -178,16 +211,40 @@ AC_MSG_RESULT([yes]) $3 fi[]dnl -])# PKG_CHECK_MODULES +])dnl PKG_CHECK_MODULES -# PKG_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable pkgconfigdir as the location where a module -# should install pkg-config .pc files. By default the directory is -# $libdir/pkgconfig, but the default can be changed by passing -# DIRECTORY. The user can override through the --with-pkgconfigdir -# parameter. +dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl --------------------------------------------------------------------- +dnl Since: 0.29 +dnl +dnl Checks for existence of MODULES and gathers its build flags with +dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags +dnl and VARIABLE-PREFIX_LIBS from --libs. +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to +dnl include an explicit call to PKG_PROG_PKG_CONFIG in your +dnl configure.ac. +AC_DEFUN([PKG_CHECK_MODULES_STATIC], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +_save_PKG_CONFIG=$PKG_CONFIG +PKG_CONFIG="$PKG_CONFIG --static" +PKG_CHECK_MODULES($@) +PKG_CONFIG=$_save_PKG_CONFIG[]dnl +])dnl PKG_CHECK_MODULES_STATIC + + +dnl PKG_INSTALLDIR([DIRECTORY]) +dnl ------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable pkgconfigdir as the location where a module +dnl should install pkg-config .pc files. By default the directory is +dnl $libdir/pkgconfig, but the default can be changed by passing +dnl DIRECTORY. The user can override through the --with-pkgconfigdir +dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], @@ -198,16 +255,18 @@ AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) -]) dnl PKG_INSTALLDIR +])dnl PKG_INSTALLDIR -# PKG_NOARCH_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable noarch_pkgconfigdir as the location where a -# module should install arch-independent pkg-config .pc files. By -# default the directory is $datadir/pkgconfig, but the default can be -# changed by passing DIRECTORY. The user can override through the -# --with-noarch-pkgconfigdir parameter. +dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) +dnl -------------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable noarch_pkgconfigdir as the location where a +dnl module should install arch-independent pkg-config .pc files. By +dnl default the directory is $datadir/pkgconfig, but the default can be +dnl changed by passing DIRECTORY. The user can override through the +dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], @@ -218,13 +277,15 @@ AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) -]) dnl PKG_NOARCH_INSTALLDIR +])dnl PKG_NOARCH_INSTALLDIR -# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, -# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# ------------------------------------------- -# Retrieves the value of the pkg-config variable for the given module. +dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------- +dnl Since: 0.28 +dnl +dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl @@ -233,7 +294,7 @@ AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl -])# PKG_CHECK_VAR +])dnl PKG_CHECK_VAR # Copyright (C) 2002-2014 Free Software Foundation, Inc. # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opusfile-0.7/configure new/opusfile-0.8/configure --- old/opusfile-0.7/configure 2016-01-05 01:35:19.000000000 +0100 +++ new/opusfile-0.8/configure 2016-07-06 19:38:02.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for opusfile 0.7. +# Generated by GNU Autoconf 2.69 for opusfile 0.8. # # Report bugs to <o...@xiph.org>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='opusfile' PACKAGE_TARNAME='opusfile' -PACKAGE_VERSION='0.7' -PACKAGE_STRING='opusfile 0.7' +PACKAGE_VERSION='0.8' +PACKAGE_STRING='opusfile 0.8' PACKAGE_BUGREPORT='o...@xiph.org' PACKAGE_URL='' @@ -1352,7 +1352,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 opusfile 0.7 to adapt to many kinds of systems. +\`configure' configures opusfile 0.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1422,7 +1422,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of opusfile 0.7:";; + short | recursive ) echo "Configuration of opusfile 0.8:";; esac cat <<\_ACEOF @@ -1553,7 +1553,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -opusfile configure 0.7 +opusfile configure 0.8 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1922,7 +1922,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by opusfile $as_me 0.7, which was +It was created by opusfile $as_me 0.8, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4359,7 +4359,7 @@ # Define the identity of the package. PACKAGE='opusfile' - VERSION='0.7' + VERSION='0.8' # Some tools Automake needs. @@ -12311,7 +12311,7 @@ OP_LT_CURRENT=4 -OP_LT_REVISION=0 +OP_LT_REVISION=1 OP_LT_AGE=4 @@ -13762,7 +13762,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by opusfile $as_me 0.7, which was +This file was extended by opusfile $as_me 0.8, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13828,7 +13828,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -opusfile config.status 0.7 +opusfile config.status 0.8 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/opusfile-0.7/configure.ac new/opusfile-0.8/configure.ac --- old/opusfile-0.7/configure.ac 2016-01-01 02:42:01.000000000 +0100 +++ new/opusfile-0.8/configure.ac 2016-07-06 19:38:00.000000000 +0200 @@ -34,7 +34,7 @@ dnl - interfaces removed -> AGE = 0 OP_LT_CURRENT=4 -OP_LT_REVISION=0 +OP_LT_REVISION=1 OP_LT_AGE=4 AC_SUBST(OP_LT_CURRENT) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opusfile-0.7/include/opusfile.h new/opusfile-0.8/include/opusfile.h --- old/opusfile-0.7/include/opusfile.h 2015-12-31 19:29:53.000000000 +0100 +++ new/opusfile-0.8/include/opusfile.h 2016-07-06 19:14:49.000000000 +0200 @@ -1713,11 +1713,11 @@ These downmix multichannel files to two channels, so they can always return samples in the same format for every link in a chained file. - If the rest of your audio processing chain can handle floating point, those - routines should be preferred, as floating point output avoids introducing - clipping and other issues which might be avoided entirely if, e.g., you - scale down the volume at some other stage. - However, if you intend to direct consume 16-bit samples, the conversion in + If the rest of your audio processing chain can handle floating point, the + floating-point routines should be preferred, as they prevent clipping and + other issues which might be avoided entirely if, e.g., you scale down the + volume at some other stage. + However, if you intend to consume 16-bit samples directly, the conversion in <tt>libopusfile</tt> provides noise-shaping dithering and, if compiled against <tt>libopus</tt> 1.1 or later, soft-clipping prevention. @@ -1770,26 +1770,35 @@ #OP_DEC_FORMAT_FLOAT. \param _li The index of the link from which this packet was decoded. \return A non-negative value on success, or a negative value on error. - The error codes should be the same as those returned by + Any error codes should be the same as those returned by opus_multistream_decode() or opus_multistream_decode_float(). + Success codes are as follows: \retval 0 Decoding was successful. The application has filled the buffer with exactly <code>\a _nsamples*\a _nchannels</code> samples in the requested format. \retval #OP_DEC_USE_DEFAULT No decoding was done. - <tt>libopusfile</tt> should decode normally - instead.*/ + <tt>libopusfile</tt> should do the decoding + by itself instead.*/ typedef int (*op_decode_cb_func)(void *_ctx,OpusMSDecoder *_decoder,void *_pcm, const ogg_packet *_op,int _nsamples,int _nchannels,int _format,int _li); /**Sets the packet decode callback function. - This is called once for each packet that needs to be decoded. + If set, this is called once for each packet that needs to be decoded. + This can be used by advanced applications to do additional processing on the + compressed or uncompressed data. + For example, an application might save the final entropy coder state for + debugging and testing purposes, or it might apply additional filters + before the downmixing, dithering, or soft-clipping performed by + <tt>libopusfile</tt>, so long as these filters do not introduce any + latency. + A call to this function is no guarantee that the audio will eventually be delivered to the application. - Some or all of the data from the packet may be discarded (i.e., at the - beginning or end of a link, or after a seek), however the callback is - required to provide all of it. + <tt>libopusfile</tt> may discard some or all of the decoded audio data + (i.e., at the beginning or end of a link, or after a seek), however the + callback is still required to provide all of it. \param _of The \c OggOpusFile on which to set the decode callback. \param _decode_cb The callback function to call. This may be <code>NULL</code> to disable calling the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opusfile-0.7/package_version new/opusfile-0.8/package_version --- old/opusfile-0.7/package_version 2016-01-05 01:35:34.000000000 +0100 +++ new/opusfile-0.8/package_version 2016-07-06 19:42:13.000000000 +0200 @@ -1 +1 @@ -PACKAGE_VERSION="0.7" +PACKAGE_VERSION="0.8" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opusfile-0.7/src/http.c new/opusfile-0.8/src/http.c --- old/opusfile-0.7/src/http.c 2015-12-31 19:29:53.000000000 +0100 +++ new/opusfile-0.8/src/http.c 2016-07-06 19:14:49.000000000 +0200 @@ -231,7 +231,7 @@ # define POLLRDBAND (0x0200) /*There is data to read.*/ # define POLLIN (POLLRDNORM|POLLRDBAND) -/* There is urgent data to read.*/ +/*There is urgent data to read.*/ # define POLLPRI (0x0400) /*Equivalent to POLLOUT.*/ # define POLLWRNORM (0x0010) @@ -894,7 +894,7 @@ /*Close the connection and move it to the free list. _stream: The stream containing the free list. _conn: The connection to close. - _penxt: The linked-list pointer currently pointing to this connection. + _pnext: The linked-list pointer currently pointing to this connection. _gracefully: Whether or not to shut down cleanly.*/ static void op_http_conn_close(OpusHTTPStream *_stream,OpusHTTPConn *_conn, OpusHTTPConn **_pnext,int _gracefully){ @@ -1517,10 +1517,17 @@ return ret; } +# if OPENSSL_VERSION_NUMBER<0x10100000L +# define BIO_set_data(_b,_ptr) ((_b)->ptr=(_ptr)) +# define BIO_set_init(_b,_init) ((_b)->init=(_init)) +# endif + static int op_bio_retry_new(BIO *_b){ - _b->init=1; + BIO_set_init(_b,1); +# if OPENSSL_VERSION_NUMBER<0x10100000L _b->num=0; - _b->ptr=NULL; +# endif + BIO_set_data(_b,NULL); return 1; } @@ -1528,6 +1535,7 @@ return _b!=NULL; } +# if OPENSSL_VERSION_NUMBER<0x10100000L /*This is not const because OpenSSL doesn't allow it, even though it won't write to it.*/ static BIO_METHOD op_bio_retry_method={ @@ -1542,11 +1550,15 @@ op_bio_retry_free, NULL }; +# endif /*Establish a CONNECT tunnel and pipeline the start of the TLS handshake for proxying https URL requests.*/ static int op_http_conn_establish_tunnel(OpusHTTPStream *_stream, OpusHTTPConn *_conn,op_sock _fd,SSL *_ssl_conn,BIO *_ssl_bio){ +# if OPENSSL_VERSION_NUMBER>=0x10100000L + BIO_METHOD *bio_retry_method; +# endif BIO *retry_bio; char *status_code; char *next; @@ -1557,13 +1569,32 @@ ret=op_http_conn_write_fully(_conn, _stream->proxy_connect.buf,_stream->proxy_connect.nbuf); if(OP_UNLIKELY(ret<0))return ret; +# if OPENSSL_VERSION_NUMBER>=0x10100000L + bio_retry_method=BIO_meth_new(BIO_TYPE_NULL,"retry"); + if(bio_retry_method==NULL)return OP_EFAULT; + BIO_meth_set_write(bio_retry_method,op_bio_retry_write); + BIO_meth_set_read(bio_retry_method,op_bio_retry_read); + BIO_meth_set_puts(bio_retry_method,op_bio_retry_puts); + BIO_meth_set_ctrl(bio_retry_method,op_bio_retry_ctrl); + BIO_meth_set_create(bio_retry_method,op_bio_retry_new); + BIO_meth_set_destroy(bio_retry_method,op_bio_retry_free); + retry_bio=BIO_new(bio_retry_method); + if(OP_UNLIKELY(retry_bio==NULL)){ + BIO_meth_free(bio_retry_method); + return OP_EFAULT; + } +# else retry_bio=BIO_new(&op_bio_retry_method); if(OP_UNLIKELY(retry_bio==NULL))return OP_EFAULT; +# endif SSL_set_bio(_ssl_conn,retry_bio,_ssl_bio); SSL_set_connect_state(_ssl_conn); /*This shouldn't succeed, since we can't read yet.*/ OP_ALWAYS_TRUE(SSL_connect(_ssl_conn)<0); SSL_set_bio(_ssl_conn,_ssl_bio,_ssl_bio); +# if OPENSSL_VERSION_NUMBER>=0x10100000L + BIO_meth_free(bio_retry_method); +# endif /*Only now do we disable write coalescing, to allow the CONNECT request and the start of the TLS handshake to be combined.*/ op_sock_set_tcp_nodelay(_fd,1); @@ -2200,7 +2231,8 @@ /*Initialize the SSL library if necessary.*/ if(OP_URL_IS_SSL(&_stream->url)&&_stream->ssl_ctx==NULL){ SSL_CTX *ssl_ctx; -# if !defined(OPENSSL_NO_LOCKING) +# if OPENSSL_VERSION_NUMBER<0x10100000L +# if !defined(OPENSSL_NO_LOCKING) /*The documentation says SSL_library_init() is not reentrant. We don't want to add our own depenencies on a threading library, and it appears that it's safe to call OpenSSL's locking functions before the @@ -2210,12 +2242,16 @@ calling SSL_library_init() at the same time, but there's not much we can do about that.*/ CRYPTO_w_lock(CRYPTO_LOCK_SSL); -# endif +# endif SSL_library_init(); /*Needed to get SHA2 algorithms with old OpenSSL versions.*/ OpenSSL_add_ssl_algorithms(); -# if !defined(OPENSSL_NO_LOCKING) +# if !defined(OPENSSL_NO_LOCKING) CRYPTO_w_unlock(CRYPTO_LOCK_SSL); +# endif +# else + /*Finally, OpenSSL does this for us, but as penance, it can now fail.*/ + if(!OPENSSL_init_ssl(0,NULL))return OP_EFAULT; # endif ssl_ctx=SSL_CTX_new(SSLv23_client_method()); if(ssl_ctx==NULL)return OP_EFAULT; @@ -2779,7 +2815,7 @@ Otherwise, we'd need a _pnext pointer if we needed to close the connection, and re-opening it would re-organize the lists.*/ OP_ASSERT(_stream->lru_head==_conn); - /*We should have filterd out empty reads by this point.*/ + /*We should have filtered out empty reads by this point.*/ OP_ASSERT(_buf_size>0); pos=_conn->pos; end_pos=_conn->end_pos; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opusfile-0.7/src/info.c new/opusfile-0.8/src/info.c --- old/opusfile-0.7/src/info.c 2015-12-31 19:29:53.000000000 +0100 +++ new/opusfile-0.8/src/info.c 2016-07-06 19:14:49.000000000 +0200 @@ -199,16 +199,21 @@ if(_tags->user_comments[ci]==NULL)return OP_EFAULT; _tags->comment_lengths[ci]=(int)count; _tags->comments=ci+1; + /*Needed by opus_tags_clear() if we fail before parsing the (optional) + binary metadata.*/ + _tags->user_comments[ci+1]=NULL; } _data+=count; len-=count; } if(len>0&&(_data[0]&1)){ if(len>(opus_uint32)INT_MAX)return OP_EFAULT; - _tags->user_comments[ncomments]=(char *)_ogg_malloc(len); - if(OP_UNLIKELY(_tags->user_comments[ncomments]==NULL))return OP_EFAULT; - memcpy(_tags->user_comments[ncomments],_data,len); - _tags->comment_lengths[ncomments]=(int)len; + if(_tags!=NULL){ + _tags->user_comments[ncomments]=(char *)_ogg_malloc(len); + if(OP_UNLIKELY(_tags->user_comments[ncomments]==NULL))return OP_EFAULT; + memcpy(_tags->user_comments[ncomments],_data,len); + _tags->comment_lengths[ncomments]=(int)len; + } } return 0; } @@ -306,7 +311,7 @@ if(OP_UNLIKELY(ret<0))return ret; comment_len=(int)strlen(_comment); comment=op_strdup_with_len(_comment,comment_len); - if(OP_UNLIKELY(_tags->user_comments[ncomments]==NULL))return OP_EFAULT; + if(OP_UNLIKELY(comment==NULL))return OP_EFAULT; _tags->user_comments[ncomments]=comment; _tags->comment_lengths[ncomments]=comment_len; _tags->comments=ncomments+1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/opusfile-0.7/src/opusfile.c new/opusfile-0.8/src/opusfile.c --- old/opusfile-0.7/src/opusfile.c 2015-12-30 02:04:15.000000000 +0100 +++ new/opusfile-0.8/src/opusfile.c 2016-07-06 19:14:49.000000000 +0200 @@ -505,6 +505,7 @@ Everything else is fatal.*/ else if(ret!=OP_ENOTFORMAT)return ret; } + /*TODO: Should a BOS page with no packets be an error?*/ } /*Get the next page. No need to clamp the boundary offset against _of->end, as all errors @@ -1823,14 +1824,11 @@ This handles the case where we're at a bitstream boundary and dumps the decoding machine. If the decoding machine is unloaded, it loads it. - It also keeps prev_packet_gp up to date (seek and read both use this; seek - uses a special hack with _readp). + It also keeps prev_packet_gp up to date (seek and read both use this). Return: <0) Error, OP_HOLE (lost packet), or OP_EOF. - 0) Need more data (only if _readp==0). - 1) Got at least one audio data packet.*/ + 0) Got at least one audio data packet.*/ static int op_fetch_and_process_page(OggOpusFile *_of, - ogg_page *_og,opus_int64 _page_offset, - int _readp,int _spanp,int _ignore_holes){ + ogg_page *_og,opus_int64 _page_offset,int _spanp,int _ignore_holes){ OggOpusLink *links; ogg_uint32_t cur_serialno; int seekable; @@ -1838,7 +1836,6 @@ int ret; /*We shouldn't get here if we have unprocessed packets.*/ OP_ASSERT(_of->ready_state<OP_INITSET||_of->op_pos>=_of->op_count); - if(!_readp)return 0; seekable=_of->seekable; links=_of->links; cur_link=seekable?_of->cur_link:0; @@ -1847,36 +1844,27 @@ for(;;){ ogg_page og; OP_ASSERT(_of->ready_state>=OP_OPENED); - /*This loop is not strictly necessary, but there's no sense in doing the - extra checks of the larger loop for the common case in a multiplexed - bistream where the page is simply part of a different logical - bitstream.*/ - do{ - /*If we were given a page to use, use it.*/ - if(_og!=NULL){ - *&og=*_og; - _og=NULL; - } - /*Keep reading until we get a page with the correct serialno.*/ - else _page_offset=op_get_next_page(_of,&og,_of->end); - /*EOF: Leave uninitialized.*/ - if(_page_offset<0)return _page_offset<OP_FALSE?(int)_page_offset:OP_EOF; - if(OP_LIKELY(_of->ready_state>=OP_STREAMSET)){ - if(cur_serialno!=(ogg_uint32_t)ogg_page_serialno(&og)){ - /*Two possibilities: - 1) Another stream is multiplexed into this logical section, or*/ - if(OP_LIKELY(!ogg_page_bos(&og)))continue; - /* 2) Our decoding just traversed a bitstream boundary.*/ - if(!_spanp)return OP_EOF; - if(OP_LIKELY(_of->ready_state>=OP_INITSET))op_decode_clear(_of); - break; - } - } - /*Bitrate tracking: add the header's bytes here. - The body bytes are counted when we consume the packets.*/ - _of->bytes_tracked+=og.header_len; + /*If we were given a page to use, use it.*/ + if(_og!=NULL){ + *&og=*_og; + _og=NULL; + } + /*Keep reading until we get a page with the correct serialno.*/ + else _page_offset=op_get_next_page(_of,&og,_of->end); + /*EOF: Leave uninitialized.*/ + if(_page_offset<0)return _page_offset<OP_FALSE?(int)_page_offset:OP_EOF; + if(OP_LIKELY(_of->ready_state>=OP_STREAMSET) + &&cur_serialno!=(ogg_uint32_t)ogg_page_serialno(&og)){ + /*Two possibilities: + 1) Another stream is multiplexed into this logical section, or*/ + if(OP_LIKELY(!ogg_page_bos(&og)))continue; + /* 2) Our decoding just traversed a bitstream boundary.*/ + if(!_spanp)return OP_EOF; + if(OP_LIKELY(_of->ready_state>=OP_INITSET))op_decode_clear(_of); } - while(0); + /*Bitrate tracking: add the header's bytes here. + The body bytes are counted when we consume the packets.*/ + else _of->bytes_tracked+=og.header_len; /*Do we need to load a new machine before submitting the page? This is different in the seekable and non-seekable cases. In the seekable case, we already have all the header information loaded @@ -1934,10 +1922,12 @@ /*If we didn't get any packets out of op_find_initial_pcm_offset(), keep going (this is possible if end-trimming trimmed them all).*/ if(_of->op_count<=0)continue; - /*Otherwise, we're done.*/ + /*Otherwise, we're done. + TODO: This resets bytes_tracked, which misses the header bytes + already processed by op_find_initial_pcm_offset().*/ ret=op_make_decode_ready(_of); if(OP_UNLIKELY(ret<0))return ret; - return 1; + return 0; } } /*The buffered page is the data we want, and we're ready for it. @@ -2088,7 +2078,7 @@ _of->prev_page_offset=_page_offset; _of->op_count=pi; /*If end-trimming didn't trim all the packets, we're done.*/ - if(OP_LIKELY(pi>0))return 1; + if(OP_LIKELY(pi>0))return 0; } } } @@ -2106,7 +2096,7 @@ _of->samples_tracked=0; ret=op_seek_helper(_of,_pos); if(OP_UNLIKELY(ret<0))return OP_EREAD; - ret=op_fetch_and_process_page(_of,NULL,-1,1,1,1); + ret=op_fetch_and_process_page(_of,NULL,-1,1,1); /*If we hit EOF, op_fetch_and_process_page() leaves us uninitialized. Instead, jump to the end.*/ if(ret==OP_EOF){ @@ -2118,7 +2108,6 @@ _of->cur_discard_count=0; ret=0; } - else if(ret>0)ret=0; return ret; } @@ -2506,8 +2495,8 @@ /*Update prev_packet_gp to allow per-packet granule position assignment.*/ _of->prev_packet_gp=best_gp; _of->prev_page_offset=best_start; - ret=op_fetch_and_process_page(_of,page_offset<0?NULL:&og,page_offset,1,0,1); - if(OP_UNLIKELY(ret<=0))return OP_EBADLINK; + ret=op_fetch_and_process_page(_of,page_offset<0?NULL:&og,page_offset,0,1); + if(OP_UNLIKELY(ret<0))return OP_EBADLINK; /*Verify result.*/ if(OP_UNLIKELY(op_granpos_cmp(_of->prev_packet_gp,_target_gp)>0)){ return OP_EBADLINK; @@ -2589,8 +2578,8 @@ if(op_pos<op_count)break; /*We skipped all the packets on this page. Fetch another.*/ - ret=op_fetch_and_process_page(_of,NULL,-1,1,0,1); - if(OP_UNLIKELY(ret<=0))return OP_EBADLINK; + ret=op_fetch_and_process_page(_of,NULL,-1,0,1); + if(OP_UNLIKELY(ret<0))return OP_EBADLINK; } OP_ALWAYS_TRUE(!op_granpos_diff(&diff,prev_packet_gp,pcm_start)); /*We skipped too far. @@ -2854,7 +2843,7 @@ } } /*Suck in another page.*/ - ret=op_fetch_and_process_page(_of,NULL,-1,1,1,0); + ret=op_fetch_and_process_page(_of,NULL,-1,1,0); if(OP_UNLIKELY(ret==OP_EOF)){ if(_li!=NULL)*_li=_of->cur_link; return 0;