diff -Nru libshout-2.4.4/configure libshout-2.4.5/configure --- libshout-2.4.4/configure 2020-10-01 22:16:32.000000000 +0000 +++ libshout-2.4.5/configure 2020-12-19 13:52:46.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libshout 2.4.4. +# Generated by GNU Autoconf 2.69 for libshout 2.4.5. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='libshout' PACKAGE_TARNAME='libshout' -PACKAGE_VERSION='2.4.4' -PACKAGE_STRING='libshout 2.4.4' +PACKAGE_VERSION='2.4.5' +PACKAGE_STRING='libshout 2.4.5' PACKAGE_BUGREPORT='icecast-dev@xiph.org' PACKAGE_URL='' @@ -669,12 +669,12 @@ VORBISFILE_LIBS VORBIS_LDFLAGS VORBIS_PREFIX -OGG_LDFLAGS -OGG_CFLAGS -OGG_LIBS -OGG_PREFIX VORBIS_LIBS VORBIS_CFLAGS +OGG_LDFLAGS +OGG_PREFIX +OGG_LIBS +OGG_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG @@ -839,9 +839,11 @@ PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR +OGG_CFLAGS +OGG_LIBS +OGG_PREFIX VORBIS_CFLAGS VORBIS_LIBS -OGG_PREFIX VORBIS_PREFIX THEORA_CFLAGS THEORA_LIBS @@ -1389,7 +1391,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 libshout 2.4.4 to adapt to many kinds of systems. +\`configure' configures libshout 2.4.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1459,7 +1461,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libshout 2.4.4:";; + short | recursive ) echo "Configuration of libshout 2.4.5:";; esac cat <<\_ACEOF @@ -1516,10 +1518,12 @@ directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path + OGG_CFLAGS C compiler flags for OGG, overriding pkg-config + OGG_LIBS linker flags for OGG, overriding pkg-config + OGG_PREFIX path to ogg installation VORBIS_CFLAGS C compiler flags for VORBIS, overriding pkg-config VORBIS_LIBS linker flags for VORBIS, overriding pkg-config - OGG_PREFIX path to ogg installation VORBIS_PREFIX path to vorbis installation THEORA_CFLAGS @@ -1597,7 +1601,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libshout configure 2.4.4 +libshout configure 2.4.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2260,7 +2264,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libshout $as_me 2.4.4, which was +It was created by libshout $as_me 2.4.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2626,10 +2630,10 @@ $as_echo "#define LIBSHOUT_MINOR 4" >>confdefs.h -$as_echo "#define LIBSHOUT_MICRO 4" >>confdefs.h +$as_echo "#define LIBSHOUT_MICRO 5" >>confdefs.h -VERSION=2.4.4 +VERSION=2.4.5 am__api_version='1.14' @@ -3146,7 +3150,7 @@ # Define the identity of the package. PACKAGE='libshout' - VERSION='2.4.4' + VERSION='2.4.5' cat >>confdefs.h <<_ACEOF @@ -13134,8 +13138,6 @@ fi -SHOUT_REQUIRES="ogg" - @@ -13257,6 +13259,66 @@ fi fi +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OGG" >&5 +$as_echo_n "checking for OGG... " >&6; } + +if test -n "$OGG_CFLAGS"; then + pkg_cv_OGG_CFLAGS="$OGG_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ogg\""; } >&5 + ($PKG_CONFIG --exists --print-errors "ogg") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_OGG_CFLAGS=`$PKG_CONFIG --cflags "ogg" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$OGG_LIBS"; then + pkg_cv_OGG_LIBS="$OGG_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ogg\""; } >&5 + ($PKG_CONFIG --exists --print-errors "ogg") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_OGG_LIBS=`$PKG_CONFIG --libs "ogg" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + OGG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ogg" 2>&1` + else + OGG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ogg" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$OGG_PKG_ERRORS" >&5 + + + # Check whether --with-ogg was given. if test "${with_ogg+set}" = set; then : @@ -13383,11 +13445,163 @@ OGG_LIBS="" OGG_CFLAGS="" OGG_LDFLAGS="" + as_fn_error $? "required Ogg library not found" "$LINENO" 5 +fi + + + + + +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + + +# Check whether --with-ogg was given. +if test "${with_ogg+set}" = set; then : + withval=$with_ogg; ogg_prefix="$withval" +else + ogg_prefix="$OGG_PREFIX" + +fi + +if test "x$ogg_prefix" = "x" -o "x$ogg_prefix" = "xyes"; then + if test "x$prefix" = "xNONE"; then + ogg_prefix=/usr/local + else + ogg_prefix="$prefix" + fi +fi + + +xt_warning=no +if test x"$GCC" = "xyes" +then + save_cflags="$CFLAGS" + CFLAGS="-Werror -I$ogg_prefix/include" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + xt_warning=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_cflags" +fi +if test "$xt_warning" = "yes" +then + : +else + OGG_CFLAGS="-I$ogg_prefix/include" + OGG_LDFLAGS="-L$ogg_prefix/lib" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libogg" >&5 +$as_echo_n "checking for libogg... " >&6; } +if ${xt_cv_lib_ogg+:} false; then : + $as_echo_n "(cached) " >&6 +else + OGG_LIBS="-logg" + +# +# check if the installed Ogg is sufficiently new. +# +ac_save_CFLAGS="$CFLAGS" +ac_save_LIBS="$LIBS" +ac_save_LDFLAGS="$LDFLAGS" +CFLAGS="$CFLAGS $OGG_CFLAGS" +LIBS="$LIBS $OGG_LIBS" +LDFLAGS="$LDFLAGS $OGG_LDFLAGS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ogg_sync_init (); +int +main () +{ +return ogg_sync_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + xt_cv_lib_ogg=ok +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + xt_cv_lib_ogg="pre v1.0, needs updating" +else + xt_cv_lib_ogg="not found" fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS="$ac_save_CFLAGS" +LDFLAGS="$ac_save_LDFLAGS" +LIBS="$ac_save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xt_cv_lib_ogg" >&5 +$as_echo "$xt_cv_lib_ogg" >&6; } +if test "x$xt_cv_lib_ogg" = "xok"; then +$as_echo "#define HAVE_OGG 1" >>confdefs.h + +else + OGG_LIBS="" + OGG_CFLAGS="" + OGG_LDFLAGS="" + as_fn_error $? "required Ogg library not found" "$LINENO" 5 +fi + + + + + +else + OGG_CFLAGS=$pkg_cv_OGG_CFLAGS + OGG_LIBS=$pkg_cv_OGG_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + HAVE_OGG="yes" + SHOUT_REQUIRES="$SHOUT_REQUIRES, ogg" + +fi +OGG_LIBS="$OGG_LDFLAGS $OGG_LIBS" +XIPH_CFLAGS="$XIPH_CFLAGS $OGG_CFLAGS" pkg_failed=no @@ -15207,7 +15421,7 @@ -ac_config_files="$ac_config_files Makefile include/Makefile include/shout/Makefile include/shout/shout.h src/Makefile src/common/net/Makefile src/common/timing/Makefile src/common/thread/Makefile src/common/avl/Makefile src/common/httpp/Makefile doc/Makefile examples/Makefile win32/Makefile shout.pc" +ac_config_files="$ac_config_files Makefile include/Makefile include/shout/Makefile include/shout/shout.h src/Makefile src/common/net/Makefile src/common/timing/Makefile src/common/thread/Makefile src/common/avl/Makefile src/common/httpp/Makefile doc/Makefile tools/Makefile examples/Makefile win32/Makefile shout.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -15767,7 +15981,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libshout $as_me 2.4.4, which was +This file was extended by libshout $as_me 2.4.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15833,7 +16047,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libshout config.status 2.4.4 +libshout config.status 2.4.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -16253,6 +16467,7 @@ "src/common/avl/Makefile") CONFIG_FILES="$CONFIG_FILES src/common/avl/Makefile" ;; "src/common/httpp/Makefile") CONFIG_FILES="$CONFIG_FILES src/common/httpp/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "win32/Makefile") CONFIG_FILES="$CONFIG_FILES win32/Makefile" ;; "shout.pc") CONFIG_FILES="$CONFIG_FILES shout.pc" ;; diff -Nru libshout-2.4.4/configure.ac libshout-2.4.5/configure.ac --- libshout-2.4.4/configure.ac 2020-10-01 22:06:56.000000000 +0000 +++ libshout-2.4.5/configure.ac 2020-12-19 12:33:42.000000000 +0000 @@ -3,7 +3,7 @@ m4_define(libshout_major, 2) m4_define(libshout_minor, 4) -m4_define(libshout_micro, 4) +m4_define(libshout_micro, 5) m4_define(libshout_version, libshout_major.libshout_minor.libshout_micro) AC_INIT([libshout], libshout_version, [icecast-dev@xiph.org]) @@ -124,7 +124,14 @@ AC_DEFINE([NO_THREAD], 1, [Define if you don't want to use the thread library]) fi -SHOUT_REQUIRES="ogg" +PKG_CHECK_MODULES([OGG], [ogg], [ + HAVE_OGG="yes" + SHOUT_REQUIRES="$SHOUT_REQUIRES, ogg" + ], [ + XIPH_PATH_OGG(, [AC_MSG_ERROR([required Ogg library not found])]) + ]) +OGG_LIBS="$OGG_LDFLAGS $OGG_LIBS" +XIPH_CFLAGS="$XIPH_CFLAGS $OGG_CFLAGS" PKG_CHECK_MODULES(VORBIS, vorbis, [ HAVE_VORBIS="yes" @@ -241,4 +248,4 @@ AC_OUTPUT([Makefile include/Makefile include/shout/Makefile include/shout/shout.h src/Makefile src/common/net/Makefile src/common/timing/Makefile src/common/thread/Makefile src/common/avl/Makefile src/common/httpp/Makefile doc/Makefile - examples/Makefile win32/Makefile shout.pc]) + tools/Makefile examples/Makefile win32/Makefile shout.pc]) diff -Nru libshout-2.4.4/debian/changelog libshout-2.4.5/debian/changelog --- libshout-2.4.4/debian/changelog 2020-10-05 00:14:48.000000000 +0000 +++ libshout-2.4.5/debian/changelog 2021-01-11 02:57:32.000000000 +0000 @@ -1,3 +1,15 @@ +libshout (2.4.5-1) unstable; urgency=medium + + * New upstream version 2.4.5. + * d/libshout3.symbols: Add new symbols. + * d/control, d/*-dev.(install,examples), d/libshout3.symbols: + - Rename libshout3-dev to libshout-dev and add a transitional package. + * d/control, d/libshout-tools.install: + - Create libshout-tools and ship the new tool. + * Update Standards-Version to 4.5.1. + + -- Unit 193 Sun, 10 Jan 2021 21:57:32 -0500 + libshout (2.4.4-1) unstable; urgency=medium * New upstream version 2.4.4. diff -Nru libshout-2.4.4/debian/control libshout-2.4.5/debian/control --- libshout-2.4.4/debian/control 2020-10-05 00:14:17.000000000 +0000 +++ libshout-2.4.5/debian/control 2021-01-11 02:57:22.000000000 +0000 @@ -17,10 +17,10 @@ Vcs-Git: https://salsa.debian.org/multimedia-team/libshout.git Vcs-Browser: https://salsa.debian.org/multimedia-team/libshout Rules-Requires-Root: no -Standards-Version: 4.5.0 +Standards-Version: 4.5.1 Homepage: https://www.icecast.org/ -Package: libshout3-dev +Package: libshout-dev Section: libdevel Architecture: any Multi-Arch: same @@ -32,8 +32,9 @@ libtheora-dev, libvorbis-dev, pkg-config -Provides: libshout-dev -Conflicts: libshout-dev +Provides: libshout3-dev +Breaks: libshout3-dev (<< 2.4.5~) +Replaces: libshout3-dev (<< 2.4.5~) Description: MP3/Ogg Vorbis broadcast streaming library (development) A library for communicating with and sending data to Icecast and Icecast 2 streaming audio servers. It handles the socket connection, the timing of @@ -57,3 +58,25 @@ A library for communicating with and sending data to Icecast and Icecast 2 streaming audio servers. It handles the socket connection, the timing of the data transmission, and prevents bad data from getting to the server. + +Package: libshout-tools +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: MP3/Ogg Vorbis broadcast streaming library - commandline tools + A library for communicating with and sending data to Icecast and Icecast 2 + streaming audio servers. It handles the socket connection, the timing of + the data transmission, and prevents bad data from getting to the server. + . + This package provides commandline tools. + +Package: libshout3-dev +Section: oldlibs +Architecture: any +Multi-Arch: same +Depends: ${misc:Depends}, libshout-dev (= ${binary:Version}) +Description: MP3/Ogg Vorbis broadcast streaming library (transitional package) + A library for communicating with and sending data to Icecast and Icecast 2 + streaming audio servers. It handles the socket connection, the timing of + the data transmission, and prevents bad data from getting to the server. + . + This is a transitional dummy package to ease upgrades to libshout-dev. diff -Nru libshout-2.4.4/debian/libshout3-dev.examples libshout-2.4.5/debian/libshout3-dev.examples --- libshout-2.4.4/debian/libshout3-dev.examples 2019-10-31 04:10:28.000000000 +0000 +++ libshout-2.4.5/debian/libshout3-dev.examples 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -usr/share/doc/libshout/example.c -usr/share/doc/libshout/nonblocking.c diff -Nru libshout-2.4.4/debian/libshout3-dev.install libshout-2.4.5/debian/libshout3-dev.install --- libshout-2.4.4/debian/libshout3-dev.install 2019-11-01 10:12:08.000000000 +0000 +++ libshout-2.4.5/debian/libshout3-dev.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -usr/include -usr/lib/*/libshout.so -usr/lib/*/libshout.a -usr/lib/*/pkgconfig -usr/share/aclocal diff -Nru libshout-2.4.4/debian/libshout3.symbols libshout-2.4.5/debian/libshout3.symbols --- libshout-2.4.4/debian/libshout3.symbols 2020-10-05 00:13:57.000000000 +0000 +++ libshout-2.4.5/debian/libshout3.symbols 2021-01-09 02:54:31.000000000 +0000 @@ -1,5 +1,5 @@ libshout.so.3 libshout3 #MINVER# -* Build-Depends-Package: libshout3-dev +* Build-Depends-Package: libshout-dev (optional)__copy_buffer@Base 2.4.1 (optional)_shout_avl_delete@Base 2.2.2 (optional)_shout_avl_get_by_index@Base 2.2.2 @@ -164,6 +164,7 @@ shout_get_client_certificate@Base 2.4.1 shout_get_connected@Base 2.2.2 shout_get_content_format@Base 2.4.3 + shout_get_content_language@Base 2.4.5 shout_get_description@Base 2.2.2 shout_get_dumpfile@Base 2.2.2 shout_get_errno@Base 2.2.2 @@ -213,6 +214,7 @@ shout_set_callback@Base 2.4.3 shout_set_client_certificate@Base 2.4.1 shout_set_content_format@Base 2.4.3 + shout_set_content_language@Base 2.4.5 shout_set_description@Base 2.2.2 shout_set_dumpfile@Base 2.2.2 shout_set_format@Base 2.2.2 diff -Nru libshout-2.4.4/debian/libshout-dev.examples libshout-2.4.5/debian/libshout-dev.examples --- libshout-2.4.4/debian/libshout-dev.examples 1970-01-01 00:00:00.000000000 +0000 +++ libshout-2.4.5/debian/libshout-dev.examples 2019-10-31 04:10:28.000000000 +0000 @@ -0,0 +1,2 @@ +usr/share/doc/libshout/example.c +usr/share/doc/libshout/nonblocking.c diff -Nru libshout-2.4.4/debian/libshout-dev.install libshout-2.4.5/debian/libshout-dev.install --- libshout-2.4.4/debian/libshout-dev.install 1970-01-01 00:00:00.000000000 +0000 +++ libshout-2.4.5/debian/libshout-dev.install 2020-12-28 23:17:52.000000000 +0000 @@ -0,0 +1,5 @@ +usr/include +usr/lib/*/libshout.so +usr/lib/*/libshout.a +usr/lib/*/pkgconfig +usr/share/aclocal diff -Nru libshout-2.4.4/debian/libshout-tools.install libshout-2.4.5/debian/libshout-tools.install --- libshout-2.4.4/debian/libshout-tools.install 1970-01-01 00:00:00.000000000 +0000 +++ libshout-2.4.5/debian/libshout-tools.install 2021-01-09 02:56:41.000000000 +0000 @@ -0,0 +1,2 @@ +usr/bin/shout +usr/share/man/man1/shout.1 diff -Nru libshout-2.4.4/examples/nonblocking.c libshout-2.4.5/examples/nonblocking.c --- libshout-2.4.4/examples/nonblocking.c 2019-08-24 11:52:16.000000000 +0000 +++ libshout-2.4.5/examples/nonblocking.c 2020-12-15 21:38:46.000000000 +0000 @@ -8,6 +8,10 @@ #include #include +#if !(defined(WIN32) && !defined(__MINGW64__) && !defined(__MINGW32__)) +#include +#endif + #include int main() @@ -70,8 +74,13 @@ if (ret == SHOUTERR_BUSY) printf("Connection pending...\n"); - while (ret == SHOUTERR_BUSY) { + while (ret == SHOUTERR_BUSY || ret == SHOUTERR_RETRY) { +#if !(defined(WIN32) && !defined(__MINGW64__) && !defined(__MINGW32__)) + static const struct timespec ts = {.tv_sec = 0, .tv_nsec = 10 * 1000 * 1000}; + nanosleep(&ts, NULL); +#else usleep(10000); +#endif ret = shout_get_connected(shout); } diff -Nru libshout-2.4.4/include/shout/shout.h.in libshout-2.4.5/include/shout/shout.h.in --- libshout-2.4.4/include/shout/shout.h.in 2019-08-24 11:52:16.000000000 +0000 +++ libshout-2.4.5/include/shout/shout.h.in 2020-12-07 15:59:40.000000000 +0000 @@ -123,6 +123,9 @@ typedef int (*shout_callback_t)(shout_t *shout, shout_event_t event, void *userdata, va_list ap); + +/* ----------------[ Generic ]---------------- */ + /* initializes the shout library. Must be called before anything else */ void shout_init(void); @@ -151,6 +154,8 @@ /* returns SHOUTERR_CONNECTED or SHOUTERR_UNCONNECTED */ int shout_get_connected(shout_t *self); + +/* ----------------[ Configuration ]---------------- */ /* Parameter manipulation functions. libshout makes copies of all parameters, * the caller may free its copies after giving them to libshout. May return * SHOUTERR_MALLOC */ @@ -207,21 +212,7 @@ const char *shout_get_mount(shout_t *self); /* Other parameters */ -int shout_set_name(shout_t *self, const char *name); // obsolete -const char *shout_get_name(shout_t *self); // obsolete - -int shout_set_url(shout_t *self, const char *url); // obsolete -const char *shout_get_url(shout_t *self); // obsolete - -int shout_set_genre(shout_t *self, const char *genre); // obsolete -const char *shout_get_genre(shout_t *self); // obsolete - -int shout_set_description(shout_t *self, const char *description); // obsolete -const char *shout_get_description(shout_t *self); // obsolete - -int shout_set_dumpfile(shout_t *self, const char *dumpfile); -const char *shout_get_dumpfile(shout_t *self); - +/* takes a SHOUT_AI_xxxx argument */ int shout_set_audio_info(shout_t *self, const char *name, const char *value); const char *shout_get_audio_info(shout_t *self, const char *name); @@ -232,9 +223,20 @@ int shout_set_public(shout_t *self, unsigned int make_public); unsigned int shout_get_public(shout_t *self); -/* takes a SHOUT_FORMAT_xxxx argument */ -int shout_set_format(shout_t *self, unsigned int format); // obsolete -unsigned int shout_get_format(shout_t *self); // obsolete +/* Set the content language. + * Values as per RFC5646 Section 2.1. + * This lists the target audiance language(s), not the language of songs + * (unless the station has a focus on songs in a specific language). + * The value of NULL is allowed if the content language is not known or is expected to change. + * + * Examples: + * A German station with moderations and news in German and Gamern and international songs + * would generally set this to "de-DE". + * A similar station in Switzerland would set this to "de-CH". + * A station with content in Portuguese, and Klingon should set this to "pt, tlh". + */ +int shout_set_content_language(shout_t *self, const char *content_language); +const char *shout_get_content_language(shout_t *self); /* Set the format of the content to send. * * format is one of SHOUT_FORMAT_xxxx. @@ -254,6 +256,9 @@ int shout_set_nonblocking(shout_t* self, unsigned int nonblocking); unsigned int shout_get_nonblocking(shout_t *self); + +/* ----------------[ Actions ]---------------- */ + /* Opens a connection to the server. All parameters must already be set */ int shout_open(shout_t *self); @@ -279,6 +284,10 @@ /* Amount of time in ms caller should wait before sending again */ int shout_delay(shout_t *self); + +/* ----------------[ MP3/AAC ONLY ]---------------- */ +/* Functions in this block are for use with MP3, and AAC streams only */ + /* Sets MP3 metadata. * Returns: * SHOUTERR_SUCCESS @@ -303,10 +312,38 @@ * SHOUTERR_MALLOC if memory can't be allocated */ int shout_metadata_add(shout_metadata_t *self, const char *name, const char *value); + +/* ----------------[ Advanced ]---------------- */ /* Advanced. Do not use. */ + int shout_control(shout_t *self, shout_control_t control, ...); int shout_set_callback(shout_t *self, shout_callback_t callback, void *userdata); + +/* ----------------[ Obsolete ]---------------- */ +/* Those functions are obsolete and MUST NOT be used in newer software. + * They may be removed with any future version. + */ + +int shout_set_name(shout_t *self, const char *name); // obsolete +const char *shout_get_name(shout_t *self); // obsolete + +int shout_set_url(shout_t *self, const char *url); // obsolete +const char *shout_get_url(shout_t *self); // obsolete + +int shout_set_genre(shout_t *self, const char *genre); // obsolete +const char *shout_get_genre(shout_t *self); // obsolete + +int shout_set_description(shout_t *self, const char *description); // obsolete +const char *shout_get_description(shout_t *self); // obsolete + +/* takes a SHOUT_FORMAT_xxxx argument */ +int shout_set_format(shout_t *self, unsigned int format); // obsolete +unsigned int shout_get_format(shout_t *self); // obsolete + +int shout_set_dumpfile(shout_t *self, const char *dumpfile); // obsolete +const char *shout_get_dumpfile(shout_t *self); // obsolete + #ifdef __cplusplus } #endif diff -Nru libshout-2.4.4/Makefile.am libshout-2.4.5/Makefile.am --- libshout-2.4.4/Makefile.am 2019-05-20 18:33:51.000000000 +0000 +++ libshout-2.4.5/Makefile.am 2020-12-16 12:50:13.000000000 +0000 @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS = 1.6 foreign ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = include src doc win32 +SUBDIRS = include src doc win32 tools if HAVE_EXAMPLES SUBDIRS += examples endif diff -Nru libshout-2.4.4/Makefile.in libshout-2.4.5/Makefile.in --- libshout-2.4.4/Makefile.in 2020-10-01 22:16:33.000000000 +0000 +++ libshout-2.4.5/Makefile.in 2020-12-19 13:52:47.000000000 +0000 @@ -188,7 +188,7 @@ ETAGS = etags CTAGS = ctags CSCOPE = cscope -DIST_SUBDIRS = include src doc win32 examples +DIST_SUBDIRS = include src doc win32 tools examples DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -388,7 +388,7 @@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.6 foreign ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = include src doc win32 $(am__append_1) +SUBDIRS = include src doc win32 tools $(am__append_1) EXTRA_DIST = INSTALL m4/shout.m4 m4/acx_pthread.m4 \ m4/ogg.m4 m4/vorbis.m4 m4/xiph_compiler.m4 m4/xiph_net.m4 \ m4/xiph_types.m4 libshout.ckport diff -Nru libshout-2.4.4/NEWS libshout-2.4.5/NEWS --- libshout-2.4.4/NEWS 2020-10-01 22:34:44.000000000 +0000 +++ libshout-2.4.5/NEWS 2020-12-19 13:50:01.000000000 +0000 @@ -1,3 +1,14 @@ +libshout 2.4.5 (20201219) + +* Improved shout.h for reading, and understanding. +* Marked dumpfile support as obsolete (as SHOUT_PROTOCOL_XAUDIOCAST already is). +* Added Support for setting the content language. +* Avoid the use of obsolete functions (#2317). +* Several small fixes for non-blocking mode (#2321, #2315). +* Corrected detection of libogg (mostly for windows targets). +* Now accept TLS mode "auto" when build without TLS support. +* Added new tool shout(1). + libshout 2.4.4 (20201001) * Fixed handling of blocking/non-blocking mode diff -Nru libshout-2.4.4/README libshout-2.4.5/README --- libshout-2.4.4/README 2016-09-04 14:23:16.000000000 +0000 +++ libshout-2.4.5/README 2020-12-19 13:49:22.000000000 +0000 @@ -2,11 +2,11 @@ -------- Libshout is a library for communicating with and sending data to an -icecast server. It handles the socket connection, the timing of the -data, and prevents bad data from getting to the icecast server. +Icecast server. It handles the socket connection, the timing of the +data, and prevents bad data from getting to the Icecast server. With just a few lines of code, a programmer can easily turn any application -into a streaming source for an icecast server. Libshout also allows +into a streaming source for an Icecast server. Libshout also allows developers who want a specific feature set (database access, request taking) to concentrate on that feature set, instead of worrying about how server communication works. @@ -17,4 +17,4 @@ Libshout is licensed under the LGPL. Please see the COPYING file for details. If you have any questions or comments, please visit us at -http://www.icecast.org or email us at team@icecast.org. +https://www.icecast.org/ or email us at team@icecast.org. diff -Nru libshout-2.4.4/src/connection.c libshout-2.4.5/src/connection.c --- libshout-2.4.4/src/connection.c 2020-08-24 16:59:36.000000000 +0000 +++ libshout-2.4.5/src/connection.c 2020-12-07 15:59:40.000000000 +0000 @@ -563,7 +563,7 @@ if (con->socket != SOCK_ERROR || con->current_socket_state != SHOUT_SOCKSTATE_UNCONNECTED) return SHOUTERR_BUSY; - if (con->nonblocking == SHOUT_BLOCKING_DEFAULT) + if (con->nonblocking != SHOUT_BLOCKING_DEFAULT) shout_connection_set_nonblocking(con, shout_get_nonblocking(shout)); port = shout->port; diff -Nru libshout-2.4.4/src/Makefile.am libshout-2.4.5/src/Makefile.am --- libshout-2.4.4/src/Makefile.am 2020-09-29 23:46:00.000000000 +0000 +++ libshout-2.4.5/src/Makefile.am 2020-12-16 12:47:08.000000000 +0000 @@ -34,7 +34,7 @@ AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/common @XIPH_CPPFLAGS@ libshout_la_LIBADD = common/net/libicenet.la common/timing/libicetiming.la common/avl/libiceavl.la\ - common/httpp/libicehttpp.la $(MAYBE_THREAD_LIB) $(THEORA_LIBS) $(VORBIS_LIBS) $(SPEEX_LIBS) @XIPH_LIBS@ + common/httpp/libicehttpp.la $(MAYBE_THREAD_LIB) $(THEORA_LIBS) $(OGG_LIBS) $(VORBIS_LIBS) $(SPEEX_LIBS) @XIPH_LIBS@ debug: diff -Nru libshout-2.4.4/src/Makefile.in libshout-2.4.5/src/Makefile.in --- libshout-2.4.4/src/Makefile.in 2020-10-01 22:16:33.000000000 +0000 +++ libshout-2.4.5/src/Makefile.in 2020-12-19 13:52:47.000000000 +0000 @@ -131,7 +131,7 @@ common/timing/libicetiming.la common/avl/libiceavl.la \ common/httpp/libicehttpp.la $(MAYBE_THREAD_LIB) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__libshout_la_SOURCES_DIST = shout.c util.c queue.c connection.c \ proto_http.c proto_xaudiocast.c proto_icy.c proto_roaraudio.c \ format_ogg.c format_webm.c format_mp3.c codec_vorbis.c \ @@ -433,7 +433,7 @@ AM_CFLAGS = @XIPH_CFLAGS@ AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/common @XIPH_CPPFLAGS@ libshout_la_LIBADD = common/net/libicenet.la common/timing/libicetiming.la common/avl/libiceavl.la\ - common/httpp/libicehttpp.la $(MAYBE_THREAD_LIB) $(THEORA_LIBS) $(VORBIS_LIBS) $(SPEEX_LIBS) @XIPH_LIBS@ + common/httpp/libicehttpp.la $(MAYBE_THREAD_LIB) $(THEORA_LIBS) $(OGG_LIBS) $(VORBIS_LIBS) $(SPEEX_LIBS) @XIPH_LIBS@ all: all-recursive diff -Nru libshout-2.4.4/src/proto_http.c libshout-2.4.5/src/proto_http.c --- libshout-2.4.4/src/proto_http.c 2019-05-22 09:05:32.000000000 +0000 +++ libshout-2.4.5/src/proto_http.c 2020-12-15 21:35:10.000000000 +0000 @@ -125,6 +125,8 @@ break; if (shout_queue_printf(connection, "Content-Type: %s\r\n", mimetype)) break; + if (self->content_language && shout_queue_printf(connection, "Content-Language: %s\r\n", self->content_language)) + break; if (poke) { if (shout_queue_str(connection, "Content-Length: 0\r\nConnection: Keep-Alive\r\n")) break; @@ -149,6 +151,8 @@ } free(ai); } + if (shout_queue_str(connection, "Prefer: return=minimal\r\n")) + break; if (shout_queue_str(connection, "\r\n")) break; diff -Nru libshout-2.4.4/src/shout.c libshout-2.4.5/src/shout.c --- libshout-2.4.4/src/shout.c 2020-08-12 16:31:43.000000000 +0000 +++ libshout-2.4.5/src/shout.c 2020-12-16 12:47:08.000000000 +0000 @@ -149,6 +149,8 @@ free(self->host); if (self->password) free(self->password); + if (self->content_language) + free(self->content_language); if (self->mount) free(self->mount); if (self->user) @@ -678,6 +680,47 @@ return self->useragent; } +int shout_set_content_language(shout_t *self, const char *content_language) +{ + const char *p; + + if (!self) + return SHOUTERR_INSANE; + + if (!content_language) { + if (self->content_language) + free(self->content_language); + return self->error = SHOUTERR_SUCCESS; + } + + // we do at least a simple check for the correct format. This will at least detect unsafe chars. + for (p = content_language; *p; p++) { + if (*p == ' ' || *p == ',') + continue; + if ((*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z') || (*p >= '0' && *p <= '9')) + continue; + if (*p == '-') + continue; + + return self->error = SHOUTERR_INSANE; + } + + + if (self->content_language) + free(self->content_language); + + if ( !(self->content_language = _shout_util_strdup(content_language)) ) + return self->error = SHOUTERR_MALLOC; + + return self->error = SHOUTERR_SUCCESS; +} + +const char *shout_get_content_language(shout_t *self) +{ + if (!self) + return NULL; + return self->content_language; +} int shout_set_user(shout_t *self, const char *username) { @@ -1145,10 +1188,11 @@ if (!self) return SHOUTERR_INSANE; - if (mode == SHOUT_TLS_DISABLED) - return SHOUTERR_SUCCESS; + if (mode != SHOUT_TLS_DISABLED && + mode != SHOUT_TLS_AUTO) + return self->error = SHOUTERR_UNSUPPORTED; - return self->error = SHOUTERR_UNSUPPORTED; + return SHOUTERR_SUCCESS; } int shout_get_tls(shout_t *self) @@ -1335,6 +1379,7 @@ } ret = shout_connection_iter(self->connection, self); + self->error = ret; if (self->connection->current_message_state == SHOUT_MSGSTATE_SENDING1 && !self->send) { int rc; diff -Nru libshout-2.4.4/src/shout_private.h libshout-2.4.5/src/shout_private.h --- libshout-2.4.4/src/shout_private.h 2019-08-24 11:52:16.000000000 +0000 +++ libshout-2.4.5/src/shout_private.h 2020-12-07 15:59:40.000000000 +0000 @@ -93,19 +93,6 @@ size_t len; } shout_queue_t; -/* -typedef enum { - SHOUT_STATE_UNCONNECTED = 0, - SHOUT_STATE_CONNECT_PENDING, - SHOUT_STATE_TLS_PENDING, - SHOUT_STATE_REQ_CREATION, - SHOUT_STATE_REQ_PENDING, - SHOUT_STATE_RESP_PENDING, - SHOUT_STATE_CONNECTED, - SHOUT_STATE_RECONNECT -} shout_state_e; -*/ - typedef enum { SHOUT_SOCKSTATE_UNCONNECTED = 0, SHOUT_SOCKSTATE_CONNECTING, @@ -218,6 +205,8 @@ unsigned int usage; /* audio encoding parameters */ util_dict *audio_info; + /* content-language */ + char *content_language; /* user-agent to use when doing HTTP login */ char *useragent; @@ -323,7 +312,7 @@ shout_connection_return_state_t shout_get_xaudiocast_response(shout_t *self, shout_connection_t *connection); shout_connection_return_state_t shout_parse_xaudiocast_response(shout_t *self, shout_connection_t *connection); -/* containsers */ +/* containers */ int shout_open_ogg(shout_t *self); int shout_open_mp3(shout_t *self); int shout_open_webm(shout_t *self); diff -Nru libshout-2.4.4/tools/Makefile.am libshout-2.4.5/tools/Makefile.am --- libshout-2.4.4/tools/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ libshout-2.4.5/tools/Makefile.am 2020-12-19 13:33:37.000000000 +0000 @@ -0,0 +1,11 @@ +AUTOMAKE_OPTIONS = foreign + +EXTRA_DIST = shout.1 + +bin_PROGRAMS = shout +AM_CFLAGS = @XIPH_CFLAGS@ -I$(top_builddir)/include -Wall -Wextra + +man1_MANS = shout.1 + +shout_SOURCES = shout.c +shout_LDADD = $(top_builddir)/src/libshout.la diff -Nru libshout-2.4.4/tools/Makefile.in libshout-2.4.5/tools/Makefile.in --- libshout-2.4.4/tools/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ libshout-2.4.5/tools/Makefile.in 2020-12-19 13:52:48.000000000 +0000 @@ -0,0 +1,736 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = shout$(EXEEXT) +subdir = tools +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ogg.m4 \ + $(top_srcdir)/m4/speex.m4 $(top_srcdir)/m4/theora.m4 \ + $(top_srcdir)/m4/vorbis.m4 $(top_srcdir)/m4/xiph_compiler.m4 \ + $(top_srcdir)/m4/xiph_net.m4 $(top_srcdir)/m4/xiph_openssl.m4 \ + $(top_srcdir)/m4/xiph_types.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" +PROGRAMS = $(bin_PROGRAMS) +am_shout_OBJECTS = shout.$(OBJEXT) +shout_OBJECTS = $(am_shout_OBJECTS) +shout_DEPENDENCIES = $(top_builddir)/src/libshout.la +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(shout_SOURCES) +DIST_SOURCES = $(shout_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(man1_MANS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG = @DEBUG@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LDFLAGS = @OGG_LDFLAGS@ +OGG_LIBS = @OGG_LIBS@ +OGG_PREFIX = @OGG_PREFIX@ +OPT = @OPT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGCONFIG = @PKGCONFIG@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PROFILE = @PROFILE@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SHOUT_CFLAGS = @SHOUT_CFLAGS@ +SHOUT_CPPFLAGS = @SHOUT_CPPFLAGS@ +SHOUT_LIBDEPS = @SHOUT_LIBDEPS@ +SHOUT_REQUIRES = @SHOUT_REQUIRES@ +SHOUT_THREADSAFE = @SHOUT_THREADSAFE@ +SHOUT_TLS = @SHOUT_TLS@ +SPEEX = @SPEEX@ +SPEEX_CFLAGS = @SPEEX_CFLAGS@ +SPEEX_LDFLAGS = @SPEEX_LDFLAGS@ +SPEEX_LIBS = @SPEEX_LIBS@ +STRIP = @STRIP@ +THEORA = @THEORA@ +THEORA_CFLAGS = @THEORA_CFLAGS@ +THEORA_LDFLAGS = @THEORA_LDFLAGS@ +THEORA_LIBS = @THEORA_LIBS@ +VERSION = @VERSION@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LDFLAGS = @VORBIS_LDFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +VORBIS_PREFIX = @VORBIS_PREFIX@ +XIPH_CFLAGS = @XIPH_CFLAGS@ +XIPH_CPPFLAGS = @XIPH_CPPFLAGS@ +XIPH_LIBS = @XIPH_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +acx_pthread_config = @acx_pthread_config@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = foreign +EXTRA_DIST = shout.1 +AM_CFLAGS = @XIPH_CFLAGS@ -I$(top_builddir)/include -Wall -Wextra +man1_MANS = shout.1 +shout_SOURCES = shout.c +shout_LDADD = $(top_builddir)/src/libshout.la +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign tools/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +shout$(EXEEXT): $(shout_OBJECTS) $(shout_DEPENDENCIES) $(EXTRA_shout_DEPENDENCIES) + @rm -f shout$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(shout_OBJECTS) $(shout_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shout.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man1: $(man1_MANS) + @$(NORMAL_INSTALL) + @list1='$(man1_MANS)'; \ + list2=''; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(MANS) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-man + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man1 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-man + +uninstall-man: uninstall-man1 + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ + clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-man1 \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-man uninstall-man1 + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru libshout-2.4.4/tools/shout.1 libshout-2.4.5/tools/shout.1 --- libshout-2.4.4/tools/shout.1 1970-01-01 00:00:00.000000000 +0000 +++ libshout-2.4.5/tools/shout.1 2020-12-16 12:50:13.000000000 +0000 @@ -0,0 +1,122 @@ +.Dd $Mdocdate: Dec 16 2020$ +.Dt SHOUT 1 +.Os +.\" +.Sh NAME +.\" +.Nm shout +.Nd Icecast source client +.\" +.Sh SYNOPSIS +.\" +.Nm +[OPTIONS] +.\" +.Sh DESCRIPTION +.\" +.Nm +reads data from standard input and streams it to Icecast. +.\" +.Sh OPTIONS +.\" +.Bl -tag -width 4n +.\" +.It Fl \-format Ar format +Set stream format. This can be "ogg", "mp3", or "webm". Default is "ogg". +.\" +.It Fl H Ar host +See +.Fl \-host +.\" +.It Fl h +See +.Fl \-help +.\" +.It Fl \-help +Show help. +.\" +.It Fl \-host Ar host +Set destination host. Default is "localhost". +.It Fl \-mount Ar string +Set mountpoint. Default is "/example.ogg". +.\" +.It Fl P Ar port +See +.Fl \-port +.\" +.It Fl \-pass Ar string +Set source password. Default is "hackme". +.\" +.It Fl \-port Ar port +Set destination port. Symbolic names are supported. Default is 8000. +.\" +.It Fl \-proto Ar protocol +Set protocol. Default is "http". +.\" STATION METADATA +.It Fl \-station-description Ar string +Set stream description. +.\" +.It Fl \-station-genre Ar string +Set stream genre. +.\" +.\" --station-meta +.It Fl \-station-meta Ar key Ns No = Ns Ar value +Set meta information. Both +.Ar key +and +.Ar value +are arbitrary strings. +.\" +.It Fl \-station-name Ar string +Set stream name. +.\" +.It Fl \-station-url Ar string +Set stream URL. +.\" +.It Fl \-tls-mode Ar tls-mode +Set TLS mode. This can be "disabled", "auto", "auto_no_plain", "rfc2818", or "rfc2817". Default is "auto". + +When libshout is build without TLS support only "disabled", and "auto" are supported. +.\" +.It Fl \-usage Ar usage{,usage} +Set stream usages. This can be: +.Bl -tag -width 13n -compact +.It Qq audio +for audio substreams +.It Qq visual +for picture/video substreams (most often combined with "audio") +.It Qq text +for text substreams that are not subtitles +.It Qq subtitle +for subtitle substreams +.It Qq light +for light control substreams +.It Qq ui +for user interface data, such as DVD menus or buttons +.It Qq metadata +for substreams that include metadata for the stream +.It Qq application +for application specific data substreams +.It Qq control +for substreams that control the infrastructure +.It Qq complex +for substreams that are themself a mixture of other types +.It Qq other +for substream of types not listed here +.It Qq unknown +for streams that may contain additional substreams of unknown nature +.It Qq 3d +for streams that contain information for 3D playback +.It Qq 4d +for streams that contain information for 4D/XD playback +.El +.\" +.It Fl \-user Ar string +Set source user. Default is "source". +.\" +.El +.\" +.Sh NOTES +If this binary is symlinked, or hardlinked to the name "oggfwd" it provides drop-in compatibly with +.Xr oggfwd 1 . +.\" diff -Nru libshout-2.4.4/tools/shout.c libshout-2.4.5/tools/shout.c --- libshout-2.4.4/tools/shout.c 1970-01-01 00:00:00.000000000 +0000 +++ libshout-2.4.5/tools/shout.c 2020-12-16 12:50:13.000000000 +0000 @@ -0,0 +1,770 @@ +/* + * Copyright (C) 2020 Philipp "ph3-der-loewe" Schafft + * Copyright (C) 2020 Jakob Wied + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#ifndef _WIN32 +#include +#include +#else +#include +#include +#include +#endif + +#include + +#define DEFAULT_MOUNT "/example.ogg" +#define DEFAULT_PASSWORD "hackme" + +/* only long options need a flag value */ +enum flag { + FLAG__NONE = 0, + FLAG_PROTO = 1, + FLAG_MOUNT = 2, + FLAG_USER = 3, + FLAG_PASS = 4, + FLAG_TLS_MODE = 5, + FLAG_FORMAT = 6, + + /* metadata */ + FLAG_STATION_DESCRIPTION = 7, + FLAG_STATION_GENRE = 8, + FLAG_STATION_NAME = 9, + FLAG_STATION_URL = 10, + FLAG_STATION_META = 11, + + /* other */ + FLAG_USAGE = 20 +}; + +struct format_usage { + char *name; + unsigned int flag; +}; + +static struct format_usage format_usages[] = { + {"audio", SHOUT_USAGE_AUDIO}, + {"visual", SHOUT_USAGE_VISUAL}, + {"text", SHOUT_USAGE_TEXT}, + {"subtitle", SHOUT_USAGE_SUBTITLE}, + {"light", SHOUT_USAGE_LIGHT}, + {"ui", SHOUT_USAGE_UI}, + {"metadata", SHOUT_USAGE_METADATA}, + {"application", SHOUT_USAGE_APPLICATION}, + {"control", SHOUT_USAGE_CONTROL}, + {"complex", SHOUT_USAGE_COMPLEX}, + {"other", SHOUT_USAGE_OTHER}, + {"unknown", SHOUT_USAGE_UNKNOWN}, + {"3d", SHOUT_USAGE_3D}, + {"4d", SHOUT_USAGE_4D}, +}; + +#ifdef SHOUT_TLS +static const char supported_tls_modes[] = "disabled|auto|auto_no_plain|rfc2818|rfc2817"; +#else +static const char supported_tls_modes[] = "disabled|auto"; +#endif + +static inline int string2format(const char *name, unsigned int *format) +{ + if (!format) + return -1; + + if (strcmp(name, "ogg") == 0) { + *format = SHOUT_FORMAT_OGG; + } else if (strcmp(name, "mp3") == 0) { + *format = SHOUT_FORMAT_MP3; + } else if (strcmp(name, "webm") == 0) { + *format = SHOUT_FORMAT_WEBM; + } else { + return -1; + } + + return 0; +} + +static inline int string2proto(const char *name, unsigned int *res) +{ + if (!res) + return -1; + + if (strcmp(name, "http") == 0) { + *res = SHOUT_PROTOCOL_HTTP; + } else if (strcmp(name, "icy") == 0) { + *res = SHOUT_PROTOCOL_ICY; + } else if (strcmp(name, "roar") == 0) { + *res = SHOUT_PROTOCOL_ROARAUDIO; + } else { + return -1; + } + + return 0; +} + +static inline int string2tlsmode(const char *name, int *res) +{ + if (!res) + return -1; + + if (strcasecmp(name, "disabled") == 0) { + *res = SHOUT_TLS_DISABLED; + } else if (strcasecmp(name, "auto") == 0) { + *res = SHOUT_TLS_AUTO; + } else if (strcasecmp(name, "auto_no_plain") == 0) { + *res = SHOUT_TLS_AUTO_NO_PLAIN; + } else if (strcasecmp(name, "rfc2818") == 0) { + *res = SHOUT_TLS_RFC2818; + } else if (strcasecmp(name, "rfc2817") == 0) { + *res = SHOUT_TLS_RFC2817; + } else { + return -1; + } + + return 0; +} + +static inline int string2port(const char *name, int *res) +{ + const struct servent *service; + + if (!name || !res) + return -1; + + service = getservbyname(name, "tcp"); + if (service) { + *res = ntohs(service->s_port); + return 0; + } else { + *res = atoi(name); + if (*res < 1 || *res > 65535) + return -1; + return 0; + } +} + +int set_mount(shout_t *self, const char *mount) +{ + if (!mount || *mount != '/' || strlen(mount) < 2) + fprintf(stderr, "Warning: Mount point not starting with a slash (\"/\").\n"); + return shout_set_mount(self, mount); +} + +int set_meta(shout_t *self, const char *name, const char *value, bool allow_unknown_key) +{ + + if (!name || !value) + return SHOUTERR_INSANE; + + if (strcmp(name, SHOUT_META_NAME) != 0 && strcmp(name, SHOUT_META_URL) != 0 && + strcmp(name, SHOUT_META_GENRE) != 0 && strcmp(name, SHOUT_META_DESCRIPTION) != 0 && + strcmp(name, SHOUT_META_IRC) != 0 && strcmp(name, SHOUT_META_AIM) != 0 && + strcmp(name, SHOUT_META_ICQ) != 0) { + if (allow_unknown_key) { + fprintf(stderr, "Warning: Invalid station metadata key (but trying to set anyway): %s\n", name); + } else { + // just reject, the caller must handle. + return SHOUTERR_INSANE; + } + } + + if (strcmp(name, SHOUT_META_URL) == 0) { + if (strstr(value, ":") == NULL) { + fprintf(stderr, "Warning: URL \"%s\" is not absolute. This may not work as expected. Please include a protocol. E.g. \"https://www.example.org/\".\n", value); + } else { + if (strncmp(value, "http://", 7) != 0 && strncmp(value, "https://", 8) != 0) { + fprintf(stderr, "Warning: Unusual protocol in URL \"%s\". This may not work as expected.\n", value); + } + } + } + + return shout_set_meta(self, name, value); +} + +void usage_oggfwd(const char *progname) +{ + fprintf(stderr, + "Usage: %s [OPTIONS] address port password mountpoint\n" + "\n" + "OPTIONS:\n" + " -d set stream description\n" + " -g set stream genre\n" + " -h show this help\n" + " -m parse metadata from file\n" + " -n set stream name\n" + " -p make stream public\n" + " -u set stream url\n" + " –T {%s}\n" + " set TLS mode\n" + , progname, supported_tls_modes); +} + +void usage_shout(const char *progname) +{ + fprintf(stderr, + "Usage: %s [OPTIONS]\n" + "\n" + "OPTIONS:\n" + "General options:\n" + " --format set format {ogg|mp3|webm}\n" + " -H , --host set host\n" + " -h, --help show this help\n" + " --mount set mountpoint (e.g. \"/example.ogg\")\n" + " -P , --port set port (e.g. \"http\", or \"8300\")\n" + " --pass set source password\n" + " --proto set protocol (e.g. \"http\")\n" + " --user set source user\n" + " --tls-mode set TLS mode {%s}\n" + " --usage set usage (e.g. \"audio\", or \"visual,audio,subtitle\")\n" + "Station metadata options:\n" + " --station-description set station description\n" + " --station-genre set station genre\n" + " --station-meta = set station meta information\n" + " --station-name set station name\n" + " --station-url set station URL\n" + , progname, supported_tls_modes); +} + +/* parse_metadata_file is called at `oggfwd -m`. + * It fills the shout struct with information read from file. + * It returns 0 on success, or -1 on error. + */ +static int parse_metadata_file(const char *path, shout_t *shout) +{ + FILE *fh; + char line[256]; + int lineno = 0; + size_t len; + char *pos; + char c; + + if ((fh = fopen(path, "r")) == NULL) { + perror(path); + return -1; + } + + while (fgets(line, sizeof(line), fh)) { + lineno++; + + len = strlen(line); + if (len == 0) { + continue; + } + + /* skip comments and empty lines */ + c = line[0]; + if ((c == '#') || (c == '\r') || (c == '\n')) { + continue; + } + + /* strip line endings */ + if (line[len-1] == '\n') { + line[len-1] = '\0'; + len--; + } + if (line[len-1] == '\r') { + line[len-1] = '\0'; + len--; + } + + /* find '=' */ + if ((pos = strchr(line, '=')) == NULL) { + fprintf(stderr, "%s:%d: syntax error\n", path, lineno); + continue; /* oggfwd doesn't abort */ + } + + *pos = '\0'; /* terminate key */ + pos++; + + if (set_meta(shout, line, pos, false) != SHOUTERR_SUCCESS) { + fprintf(stderr, "%s:%d: \"%s\" is not a valid key\n", + path, lineno, line); + continue; /* oggfwd doesn't abort */ + } + } + + if (feof(fh) == 0) { + perror(path); + fclose(fh); + return -1; + } + + fclose(fh); + return 0; +} + +static int string2usage(char *str, unsigned int *usage) +{ + char *tok; + size_t i; + + if (!usage) + return -1; + + *usage = 0; /* clean for ORing */ + + /* split string on commas */ + for (tok = strtok(str, ","); tok; (tok = strtok(NULL, ","))) { + int found = 0; + + /* match token with predefined usages */ + for (i = 0; i < (sizeof(format_usages) / sizeof(format_usages[0])); i++) { + if (strcmp(tok, format_usages[i].name) == 0) { + *usage |= format_usages[i].flag; + found = 1; + break; + } + } + + if (!found) + return -1; + } + + return 0; +} + +static int getopts_oggfwd(int argc, char *argv[], shout_t *shout) +{ + const int ok = SHOUTERR_SUCCESS; /* helps to keep lines at 80 chars */ + int c; + int tls_mode; + int port; + + while ((c = getopt(argc, argv, "d:g:hm:n:pu:T:")) != -1) { + switch (c) { + case 'd': + if (set_meta(shout, SHOUT_META_DESCRIPTION, optarg, false) != ok) { + fprintf(stderr, "Error setting description: %s\n", + shout_get_error(shout)); + return -1; + } + break; + + case 'g': + if (set_meta(shout, SHOUT_META_GENRE, optarg, false) != ok) { + fprintf(stderr, "Error setting genre: %s\n", + shout_get_error(shout)); + return -1; + } + break; + + case 'h': + usage_oggfwd(argv[0]); + return -1; /* stop further processing */ + + case 'm': + if (parse_metadata_file(optarg, shout) != 0) { + return -1; + } + break; + + case 'n': + if (set_meta(shout, SHOUT_META_NAME, optarg, false) != ok) { + fprintf(stderr, "Error setting name: %s\n", + shout_get_error(shout)); + return -1; + } + break; + + case 'p': + if (shout_set_public(shout, 1) != ok) { + fprintf(stderr, "Error setting public: %s\n", + shout_get_error(shout)); + return -1; + } + break; + + case 'u': + if (set_meta(shout, SHOUT_META_URL, optarg, false) != ok) { + fprintf(stderr, "Error setting url: %s\n", + shout_get_error(shout)); + return -1; + } + break; + case 'T': + if (string2tlsmode(optarg, &tls_mode) != 0) { + fprintf(stderr, "Error parsing TLS mode: %s: Invalid protocol name", optarg); + return -1; + } + + if (shout_set_tls(shout, tls_mode) != ok) { + fprintf(stderr, "Error setting TLS mode: %s\n", + shout_get_error(shout)); + return -1; + } + break; + + default: + usage_oggfwd(argv[0]); + return -1; + } + } + + /* need exacly 4 remaining arguments */ + if ((argc - optind) != 4) { + fprintf(stderr, "Wrong number of arguments\n"); + usage_oggfwd(argv[0]); + return -1; + } + + if (shout_set_host(shout, argv[optind++]) != SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting hostname: %s\n", shout_get_error(shout)); + return -1; + } + + if (string2port(argv[optind], &port) != 0) { + fprintf(stderr, "Error parsing port: %s: Invalid port name\n", argv[optind]); + return -1; + } + if (shout_set_port(shout, port) != SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting port: %s\n", shout_get_error(shout)); + return -1; + } + optind++; + + if (shout_set_password(shout, argv[optind++]) != SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting password: %s\n", shout_get_error(shout)); + return -1; + } + + if (set_mount(shout, argv[optind++]) != SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting mount: %s\n", shout_get_error(shout)); + return -1; + } + + return 0; +} + +static int getopts_shout(int argc, char *argv[], shout_t *shout) +{ + int flag = FLAG__NONE; + const struct option possible[] = { + /* connection options */ + {"proto", required_argument, &flag, FLAG_PROTO}, + {"host", required_argument, NULL, 'H'}, + {"port", required_argument, NULL, 'P'}, + {"mount", required_argument, &flag, FLAG_MOUNT}, + {"user", required_argument, &flag, FLAG_USER}, + {"pass", required_argument, &flag, FLAG_PASS}, + {"tls-mode", required_argument, &flag, FLAG_TLS_MODE}, + /* metadata options */ + {"station-description", required_argument, &flag, FLAG_STATION_DESCRIPTION}, + {"station-genre", required_argument, &flag, FLAG_STATION_GENRE}, + {"station-name", required_argument, &flag, FLAG_STATION_NAME}, + {"station-url", required_argument, &flag, FLAG_STATION_URL}, + {"station-meta", required_argument, &flag, FLAG_STATION_META}, + /* other options */ + {"format", required_argument, &flag, FLAG_FORMAT}, + {"usage", required_argument, &flag, FLAG_USAGE}, + {"help", no_argument, NULL, 'h'}, + {NULL, 0, NULL, 0}, + }; + + int format_set = 0, format_usage_set = 0; + unsigned int format, format_usage; + unsigned int proto; + int tls_mode; + char *pos; + int port; + int c; + int i = 0; + + while ((c = getopt_long(argc, argv, "H:hP:", possible, &i)) != -1) { + switch (c) { + case 'H': + if (shout_set_host(shout, optarg) != SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting hostname: %s\n", + shout_get_error(shout)); + return -1; + } + break; + + case 'h': + usage_shout(argv[0]); + return -1; + + case 'P': + if (string2port(optarg, &port) != 0) { + fprintf(stderr, "Error parsing port: %s: Invalid port name\n", optarg); + return -1; + } + if (shout_set_port(shout, port) != SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting port: %s\n", + shout_get_error(shout)); + return -1; + } + break; + + case 0: /* long-only option */ + switch ((enum flag)flag) { + case FLAG_PROTO: + if (string2proto(optarg, &proto) != 0) { + fprintf(stderr, "Error parsing protocol: %s: Invalid protocol name\n", optarg); + return -1; + } + if (shout_set_protocol(shout, proto) != + SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting protocol: %s\n", + shout_get_error(shout)); + return -1; + } + break; + case FLAG_MOUNT: + if (set_mount(shout, optarg) != + SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting mount: %s\n", + shout_get_error(shout)); + return -1; + } + break; + case FLAG_USER: + if (shout_set_user(shout, optarg) != + SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting user: %s\n", + shout_get_error(shout)); + return -1; + } + break; + case FLAG_PASS: + if (shout_set_password(shout, optarg) != + SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting password: %s\n", + shout_get_error(shout)); + return -1; + } + break; + case FLAG_TLS_MODE: + if (string2tlsmode(optarg, &tls_mode) != 0) { + fprintf(stderr, "Error parsing TLS mode: %s: Invalid protocol name", optarg); + return -1; + } + + if (shout_set_tls(shout, tls_mode) != + SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting TLS mode: %s\n", + shout_get_error(shout)); + return -1; + } + break; + + /* metadata options */ + case FLAG_STATION_DESCRIPTION: + if (set_meta(shout, SHOUT_META_DESCRIPTION, optarg, false) != SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting description: %s\n", shout_get_error(shout)); + return -1; + } + break; + case FLAG_STATION_GENRE: + if (set_meta(shout, SHOUT_META_GENRE, optarg, false) != SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting genre: %s\n", shout_get_error(shout)); + return -1; + } + break; + case FLAG_STATION_NAME: + if (set_meta(shout, SHOUT_META_NAME, optarg, false) != SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting name: %s\n", shout_get_error(shout)); + return -1; + } + break; + case FLAG_STATION_URL: + if (set_meta(shout, SHOUT_META_URL, optarg, false) != SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting URL: %s\n", shout_get_error(shout)); + return -1; + } + break; + case FLAG_STATION_META: + /* find '=' */ + if ((pos = strchr(optarg, '=')) == NULL) { + fprintf(stderr, "%s: Missing '='\n", optarg); + return -1; + } + *pos = '\0'; /* terminate key */ + + if (set_meta(shout, optarg, pos + 1, true) != SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting meta information: %s\n", shout_get_error(shout)); + return -1; + } + break; + + /* other options */ + case FLAG_FORMAT: + /* backup usage */ + shout_get_content_format(shout, &format, &format_usage, NULL); + + if (string2format(optarg, &format) != 0) { + fprintf(stderr, "%s: Invalid format name\n", optarg); + return -1; + } + if (shout_set_content_format(shout, format, format_usage, NULL) != SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting format: %s\n", + shout_get_error(shout)); + return -1; + } + format_set = 1; /* may need to set usage below */ + break; + + case FLAG_USAGE: + /* backup format */ + shout_get_content_format(shout, &format, &format_usage, NULL); + + if (string2usage(optarg, &format_usage) != 0) { + fprintf(stderr, "Invalid format usage\n"); + return -1; + } + + if (shout_set_content_format(shout, format, format_usage, NULL) != SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting format and usage: %s\n", shout_get_error(shout)); + return -1; + } + format_usage_set = 1; /* don't override usage below */ + break; + + default: + usage_shout(argv[0]); + return -1; + break; + } + break; + default: /* unknown short option */ + usage_shout(argv[0]); + return -1; + break; + } + } + + /* set default usage for format */ + if (format_set && !format_usage_set) { + switch (format) { + case SHOUT_FORMAT_OGG: + format_usage = SHOUT_USAGE_UNKNOWN; + break; + case SHOUT_FORMAT_MP3: + format_usage = SHOUT_USAGE_AUDIO; + break; + case SHOUT_FORMAT_WEBM: + format_usage = SHOUT_USAGE_AUDIO|SHOUT_USAGE_VISUAL; + break; + default: /* unknown format => unknown usage */ + format_usage = SHOUT_USAGE_UNKNOWN; + break; + } + + if (shout_set_content_format(shout, format, format_usage, NULL) != SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting format and usage: %s\n", shout_get_error(shout)); + return -1; + } + format_usage_set = 1; + } + + /* prohibit trailing arguments + * NOTE: maybe we should treat them as input files + */ + if (optind != argc) { + for (; optind < argc; optind++) { + fprintf(stderr, "%s: unused argument\n", argv[optind]); + } + fprintf(stderr, "\n"); /* don't stick usage to warnings */ + usage_shout(argv[0]); + return -1; + } + + return 0; +} + +int main (int argc, char *argv[]) +{ + unsigned char buf[4096]; + int err; + size_t nread = 0; + const char *progname; /* don't use __progname from glibc */ + shout_t *shout; + +#ifdef _WIN32 + if (_setmode(_fileno(stdin), _O_BINARY) == -1) { + fprintf(stderr, "Could not set stdin to binary mode\n"); + return EXIT_FAILURE; + } +#endif + + shout_init(); + + if (!(shout = shout_new())) { + fprintf(stderr, "Could not allocate shout_t\n"); + return EXIT_FAILURE; + } + + if ((progname = basename(argv[0])) && (strcmp(progname, "oggfwd") == 0 || strcmp(progname, "oggfwd.exe") == 0)) { + err = getopts_oggfwd(argc, argv, shout); + } else { + err = getopts_shout(argc, argv, shout); + } + if (err) { + return EXIT_FAILURE; + } + + /* mount is not set by shout_new */ + if (!shout_get_mount(shout)) { + if (set_mount(shout, DEFAULT_MOUNT) != SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting mount: %s\n", shout_get_error(shout)); + return EXIT_FAILURE; + } + } + + /* password is not set by shout_new */ + if (!shout_get_password(shout)) { + if (shout_set_password(shout, DEFAULT_PASSWORD) != SHOUTERR_SUCCESS) { + fprintf(stderr, "Error setting password: %s\n", shout_get_error(shout)); + return EXIT_FAILURE; + } + } + + if (shout_open(shout) != SHOUTERR_SUCCESS) { + fprintf(stderr, "Error connecting: %s\n", shout_get_error(shout)); + return EXIT_FAILURE; + } + + while ((nread = fread(buf, 1, sizeof(buf), stdin)) > 0) { + if(shout_send(shout, buf, nread) != SHOUTERR_SUCCESS) { + fprintf(stderr, "Error sending: %s\n", shout_get_error(shout)); + return EXIT_FAILURE; + } + + shout_sync(shout); + } + + shout_close(shout); + shout_shutdown(); + + /* don't return 0 if the loop isn't terminated by EOF */ + if (feof(stdin) == 0) { + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +}