diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6561464 --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +Makefile.in +aclocal.m4 +compile +config.guess +config.h.in +config.sub +configure +depcomp +install-sh +libtool.m4 +ltmain.sh +ltoptions.m4 +ltsugar.m4 +ltversion.m4 +lt~obsolete.m4 +missing diff --git a/COPYING b/COPYING index 0f70097..cbb3bc4 100644 --- a/COPYING +++ b/COPYING @@ -1,6 +1,6 @@ ezstream - source client for Icecast with external en-/decoder support Copyright (C) 2003, 2004, 2005, 2006 Ed Zaleski - Copyright (C) 2007, 2009 Moritz Grimm + Copyright (C) 2007, 2009, 2015 Moritz Grimm The ezstream program, in its entirety, is licensed under the terms and diff --git a/ChangeLog b/ChangeLog index b6dc270..6395a94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,2023 +1,2 @@ -2009-08-30 21:55 moritz - - * [r16537] NEWS, doc/ezstream.1.in.in, src/ezstream.c: - Teach ezstream a different mode of operation, as a one-shot line - shuffling tool. - -2009-08-30 21:46 moritz - - * [r16536] src/ezstream.h, src/playlist.c: - Support reading playlists from standard input. - -2009-08-30 20:34 moritz - - * [r16535] examples/Makefile.am, - examples/ezstream-file_template.xml: - Add an example template configuration for ezstream-file.sh(1). - -2009-08-30 19:41 moritz - - * [r16534] src/ezstream-file.sh.in: - Move the verbose error check where it belongs. - -2009-08-30 19:38 moritz - - * [r16533] COPYING, doc/ezstream-file.sh.1.in.in, - doc/ezstream.1.in.in: - Some licensing blah-blah and RCS IDs. - -2009-08-30 18:28 moritz - - * [r16532] NEWS: - Merge two related changes into one bullet point, and set release - date to tomorrow. - -2009-08-30 18:23 moritz - - * [r16531] src/ezstream-file.sh.in: - Do not quote $EZSTREAM, which breaks paths with whitespace but - allows to smuggle in default command line arguments. - -2009-08-30 18:22 moritz - - * [r16530] doc/ezstream-file.sh.1.in.in: - Tweak. - -2009-08-30 12:49 moritz - - * [r16529] NEWS, configure.in, doc/Makefile.am, - doc/ezstream-file.sh.1.in.in, doc/ezstream.1.in, - doc/ezstream.1.in.in, src/Makefile.am, src/ezstream-file.sh.in: - Add new wrapper/convenience script ezstream-file.sh -- generates - ezstreams on- the-fly. - -2009-08-29 09:37 moritz - - * [r16528] src/ezstream.c: - Remove pointless and (at this point) irritating warning message. - -2009-08-29 09:36 moritz - - * [r16527] NEWS, src/ezstream.c: - The original reason to abort ezstream when running into problems - opening a media file was to prevent a very verbose infinite loop - (e.g. when accidentially playing an outdated playlist.) Bring - that back by aborting after 100 subsequent errors. - -2009-08-29 09:14 moritz - - * [r16526] NEWS, src/playlist.c: - ... also fix ezstream in this regard: No need to complain when - receiving such an empty line, and not receiving any output should - not be a fatal error. Consider the latter to be - "end-of-playlist", too. - -2009-08-29 09:12 moritz - - * [r16525] examples/playlist-logger.sh: - Listen to my own documentation: the end-of-playlist case is - indicated by an empty line. But ... - -2009-08-28 15:55 moritz - - * [r16523] NEWS, examples/Makefile.am, examples/meta.sh, - examples/play.sh, examples/playlist-logger.sh: - Add a more fancy playlist script. - -2009-08-22 10:03 moritz - - * [r16497] NEWS, src/ezstream.c: - #1585: Continue when openResource() fails. - -2009-08-01 18:44 moritz - - * [r16388] configure.in, win32/config.h: - Post-release version bump. - -2009-08-01 16:36 moritz - - * [r16383] ChangeLog: - Sync. - -2009-08-01 16:32 moritz - - * [r16382] m4/taglib.m4: - Fix copy+paste'o. - -2009-08-01 16:15 moritz - - * [r16381] README: - Almost everyone chooses the pkg-config(1) way and installs - shout.pc. Document how to configure ezstream on differently - enabled systems. ... heh, PC talk is so deliciously nasty. - -2009-08-01 16:08 moritz - - * [r16380] m4/libshout.m4: - Give it a chance to link statically. - -2009-08-01 16:08 moritz - - * [r16379] m4/taglib.m4: - Check for taglib_c in the libtag_c test. - -2009-08-01 16:01 moritz - - * [r16378] m4/libxml2.m4: - Don't use AC_RUN_IFELSE (breaks cross-compiles.) - -2009-08-01 15:28 moritz - - * [r16377] m4/libshout.m4: - Do not rely on a succesful pkg-config(1) check for libshout2, as - there are still some systems where only shout-config gets - installed (NetBSD for example.) - -2009-08-01 15:26 moritz - - * [r16376] autogen.sh: - Fix for non-libtool project. - -2009-08-01 13:52 moritz - - * [r16375] autogen.sh: - Update to what I use everywhere else now. - -2009-08-01 13:50 moritz - - * [r16374] NEWS: - Today is (the real) release day. - -2009-08-01 13:46 moritz - - * [r16373] m4/ccflags.m4, m4/libshout.m4, m4/libvorbis.m4, - m4/libxml2.m4, m4/taglib.m4: - Update m4 macros to latest version. - -2009-08-01 10:54 moritz - - * [r16372] win32/Makefile.am, win32/tfile.cpp: - Add and redistribute tfile.cpp, which I needed to modify in order - to build Taglib 1.4 on Windows. This should also satisfy the - LGPL. - -2009-08-01 10:51 moritz - - * [r16371] win32/Makefile.am: - Distribute taglib project files. - -2009-08-01 10:49 moritz - - * [r16370] win32/ezstream.sln, win32/ezstream.vcproj, - win32/taglib.vcproj, win32/taglib_c.vcproj: - Downgrade the Taglib project files to v1.4 -- this actually works - now, so hook it up to ezstream. - -2009-08-01 09:04 moritz - - * [r16369] win32/taglib.vcproj, win32/taglib_c.vcproj: - Make these look like the other project files; maybe it helps with - the linking issue (to be tested later.) - -2009-07-26 10:52 moritz - - * [r16337] configure.in: - Whitespace removal for consistency with other projects. - -2009-07-22 20:19 moritz - - * [r16319] NEWS, doc/ezstream.1.in, examples/ezstream_mp3.xml, - examples/ezstream_vorbis.xml, src/configfile.c, src/configfile.h, - src/util.c: - Akos Veres suggested that ezstream should be able to set the - login username, and I concur. - -2009-07-17 22:52 moritz - - * [r16296] win32/ezstream.sln: - Remove taglib projects again. I failed to build a taglib that can - be coerced into linking statically with ezstream. *sigh* ... - hours of frustrating trial and error for nothing. - - Without a bright idea real soon, the next release -- whose sole - purpose is to fix TagLib support on Windows -- will require - tag.dll and tag_c.dll to be shipped and installed as well. - -2009-07-12 22:05 moritz - - * [r16268] win32/taglib.vcproj, win32/taglib_c.vcproj: - EOL style. - -2009-07-12 22:03 moritz - - * [r16267] win32/ezstream.sln, win32/taglib.vcproj, - win32/taglib_c.vcproj: - This still doesn't work right, but commit to avoid losing work. - -2009-07-12 16:40 moritz - - * [r16266] NEWS: - Actually, no ... *grr*. - -2009-07-12 16:27 moritz - - * [r16265] ChangeLog: - Sync. - -2009-07-12 16:24 moritz - - * [r16264] NEWS: - Today is release day. - -2009-06-21 14:35 moritz - - * [r16150] src/configfile.h: - Actually, we agreed on GPLv2 only ... - -2009-06-21 14:21 moritz - - * [r16149] NEWS, README, configure.in, m4/ccflags.m4, - m4/libshout.m4, m4/libvorbis.m4, m4/libxml2.m4, m4/progname.m4, - m4/taglib.m4, m4/tree.m4, m4/vacopy.m4, m4/vars.m4: - Update m4 macros, allowing for more easy control over the build - process among other things. Fix a silly bug in --enable-debug - while there. - -2009-06-21 14:08 moritz - - * [r16148] m4/libogg.m4: - No need for this, a direct dependency check on libogg is not - being done. - -2009-04-21 16:51 moritz - - * [r15943] NEWS: - Update. - -2009-04-21 16:47 moritz - - * [r15942] win32/config.h: - Build with TagLib support. (Ticket #1535) - -2009-03-28 22:58 moritz - - * [r15888] win32/compat.h: - Add missing newline at end of file. - -2009-03-28 22:58 moritz - - * [r15887] win32/config.h: - Post-release version bump here, too. - -2009-03-28 22:56 moritz - - * [r15886] configure.in: - Post-release version bump. - -2009-03-28 18:47 moritz - - * [r15881] ChangeLog: - Sync. - -2009-03-28 18:33 moritz - - * [r15880] NEWS: - If everything goes to plan, then today is release day. - -2009-03-28 15:40 moritz - - * [r15876] win32/README.win32: - vcredist is now a requirement, and mention FLAC. - -2009-03-28 13:38 moritz - - * [r15875] examples/ezstream_reencode_mp3.xml, - examples/ezstream_reencode_vorbis.xml: - Remove -x argument to lame. This makes the examples work for me - by default again, with a more recent lame version. - -2009-03-28 11:14 moritz - - * [r15874] m4/vars.m4: - AX_UNIQVAR_PREPEND needs to reverse its arguments before - prepending. - -2009-03-19 08:14 moritz - - * [r15799] configure.in: - Autoconf/M4 chokes on CRLF line endings in configure.in/.ac, so - enforce LF on configure.in. Found out the hard way by Roman - Donchenko. - -2009-03-18 20:24 moritz - - * [r15798] configure.in, src/compat.c, src/ezstream.h, - src/strtonum.c, win32/compat.h, win32/config.h: - Finish up the modifications to the Windows build. In case - anything remains to be done, it'll be nits. - -2009-03-18 20:15 moritz - - * [r15797] src/metadata.c: - Mh... compiling before commit would've helped. - -2009-03-18 19:57 moritz - - * [r15796] src/metadata.c: - Make metadata_get_name() return UTF8, which is what the rest of - ezstream now expects. From Roman Donchenko. - -2009-03-18 19:55 moritz - - * [r15795] configure.in, src/compat.c, src/ezstream.c, - src/ezstream.h, win32/ezstream.vcproj: - Repair some fallout from previous commits, and work more on Win32 - builds. - -2009-03-18 09:10 moritz - - * [r15794] configure.in, src/Makefile.am, src/compat.c, - src/compat.h, src/configfile.c, src/ezstream.c, src/ezstream.h, - src/getopt.c, src/metadata.c, src/playlist.c, src/util.c, - src/xalloc.c, src/xalloc.h, win32/compat.h: - Work towards cleaner portability goo, and remove some ununsed - code while there. - -2009-03-17 22:25 moritz - - * [r15793] configure.in, win32/Makefile.am, win32/shout: - Adjust auto-fu to handle the changed win32/ stuff. - -2009-03-17 22:18 moritz - - * [r15792] win32/compat.h, win32/config.h, win32/ezstream.sln, - win32/ezstream.vcproj, win32/libflac.vcproj, win32/libogg.vcproj, - win32/libshout.vcproj, win32/libspeex.vcproj, - win32/libtheora.vcproj, win32/libvorbis.vcproj, - win32/libvorbisfile.vcproj, win32/libz.vcproj, win32/shout, - win32/shout/Makefile.am, win32/shout/shout.h: - After having lost the previous build environment some time ago, I - had to start over completely. What a chore ... Anyways, commit - this to make it easier to get back to a MSVC build, in case this - happens again. - -2009-03-17 18:56 moritz - - * [r15791] NEWS: - Write complete sentences. - -2009-03-17 18:32 moritz - - * [r15790] configure.in, doc/Makefile.am, doc/ezstream.1.in: - Set the manual date to the build date. - -2009-03-17 18:29 moritz - - * [r15789] COPYING, src/compat.h, src/configfile.c, src/ezstream.c, - src/metadata.c, src/playlist.c, src/util.c: - Bump copyright year where applicable. - -2009-03-17 18:20 moritz - - * [r15788] COPYING, ChangeLog, INSTALL, Makefile.am, NEWS, README, - autogen.sh, build-aux/Makefile.am, build-aux/config.rpath, - compat/Makefile.am, compat/sys/Makefile.am, compat/sys/tree.3, - compat/sys/tree.h, configure.in, doc/Makefile.am, - doc/ezstream.1.in, examples/Makefile.am, - examples/ezstream_metadata.xml, examples/ezstream_mp3.xml, - examples/ezstream_reencode_mp3.xml, - examples/ezstream_reencode_theora.xml, - examples/ezstream_reencode_vorbis.xml, - examples/ezstream_stdin_vorbis.xml, examples/ezstream_vorbis.xml, - examples/meta.sh, examples/play.sh, m4/Makefile.am, - m4/ccflags.m4, m4/libogg.m4, m4/libshout.m4, m4/libvorbis.m4, - m4/libxml2.m4, m4/progname.m4, m4/taglib.m4, m4/tree.m4, - m4/vacopy.m4, m4/vars.m4, mkcl.sh, src/Makefile.am, src/compat.c, - src/compat.h, src/configfile.c, src/configfile.h, src/ezstream.c, - src/getopt.c, src/metadata.c, src/metadata.h, src/playlist.c, - src/playlist.h, src/strfctns.h, src/strlcat.c, src/strlcpy.c, - src/strtonum.c, src/util.c, src/util.h, src/xalloc.c, - src/xalloc.h, win32/Makefile.am, win32/README.win32, - win32/config.h, win32/ezstream.sln, win32/ezstream.vcproj: - Native EOL-style, and Id tags in a couple of places. - -2009-03-17 18:07 moritz - - * [r15787] README: - Consistent formatting. - -2009-03-17 18:03 moritz - - * [r15786] NEWS: - Mention the miscellaneous stuff I also did. - -2009-03-16 22:59 moritz - - * [r15782] Makefile.am, NEWS, README, configure.in, - m4/libvorbis.m4, m4/taglib.m4, src/metadata.c: - #1398: Make optional components optional. (For real.) - -2009-03-16 20:39 moritz - - * [r15781] src/compat.c: - It's stupid to put my own copyright on a file where I didn't - really write the code. Luckily, I had the proper copyright - statement in there already, so moving it fixes things. - -2009-03-16 20:22 moritz - - * [r15780] src/configfile.c, src/ezstream.c, src/metadata.c, - src/playlist.c, src/util.c: - Squelch another bunch of warnings after checking that what's - happening is what's wanted. - -2009-03-16 20:12 moritz - - * [r15779] configure.in, src/Makefile.am, src/compat.h, - src/ezstream.c, src/getopt.c, src/getopt.h: - Use a wrapper around getopt() for portability. This uses the - system getopt() whenever possible, and otherwise uses a stripped - down, single options only, BSD getopt() (which is smaller and - doesn't come with ifdef-stuff-in-features.h.) - -2009-03-16 19:51 moritz - - * [r15778] src/util.c: - Guarantee that iconvert() never returns NULL. This is a clumsy, - but effective way to prevent NULL dereferences after the recent - character conversion changes in other parts of ezstream. - -2009-03-16 00:40 moritz - - * [r15777] configure.in, m4/taglib.m4: - Unbreak the TagLib checks. - -2009-03-16 00:08 moritz - - * [r15776] Makefile.am, NEWS, README, autogen.sh, - build-aux/Makefile.am, compat/Makefile.am, - compat/sys/Makefile.am, configure.in, doc/Makefile.am, - examples/Makefile.am, m4/Makefile.am, m4/ccflags.m4, - m4/libogg.m4, m4/libshout.m4, m4/libvorbis.m4, m4/libxml2.m4, - m4/progname.m4, m4/taglib.m4, m4/tree.m4, m4/vacopy.m4, - m4/vars.m4, m4/xiph_compiler.m4, m4/xiph_xml2.m4, - src/Makefile.am, win32/Makefile.am: - Overhaul the ezstream build system, using my own library of - autoconf macros. There are a few benefits to this, but the main - reason is consistency and me completely understanding what's - going on. Regressions are not expected, but wouldn't surprise - either ... this needs lots of testing. - -2009-03-15 17:18 moritz - - * [r15775] src/configfile.c, src/ezstream.c, src/metadata.c, - src/playlist.c, src/util.c, src/util.h: - Assorted type fixes, unshadowing of variables, etc. - -2009-03-15 13:15 moritz - - * [r15774] m4/Makefile.am, m4/shout.m4: - "pkg-config --libs shout" has produced correct results for a long - time now, making a custom shout.m4 obsolete. - -2009-03-15 13:13 moritz - - * [r15773] m4/iconv.m4: - Remove iconv.m4, it comes with gettext (i.e. gettext-devel) - packages. - -2009-03-15 13:12 moritz - - * [r15772] m4/Makefile.am, m4/ogg.m4, m4/vorbis.m4: - Remove ogg.m4 and vorbis.m4; the ones installed by libogg/-vorbis - are fine. - -2009-03-15 11:15 moritz - - * [r15771] NEWS: - Update. - -2009-03-15 11:05 moritz - - * [r15770] src/configfile.c, src/ezstream.c: - Perform more charset conversions where necessary. This should fix - the handling of files with non-ASCII filenames, as well as some - more cases related to metadata. From Roman Donchenko , with some minor fixes by myself. - -2009-03-15 11:00 moritz - - * [r15769] src/compat.h: - Fixes for MinGW. From Roman Donchenko . - -2009-03-15 10:59 moritz - - * [r15768] src/util.h: - Add missing include for shout_t. From Roman Donchenko . - -2009-03-15 10:55 moritz - - * [r15767] NEWS, compat/sys/tree.3, compat/sys/tree.h: - Update tree macros. The manual now actually has an acceptable - license. - -2007-12-01 21:43 moritz - - * [r14260] configure.in, win32/config.h: - Post-release version bump. - -2007-12-01 21:21 moritz - - * [r14257] ChangeLog: - Sync. - -2007-12-01 21:13 moritz - - * [r14256] NEWS: - It has been very quiet after 0.5.2, so get this minor bugfix - release out the door today. - -2007-12-01 16:02 moritz - - * [r14255] NEWS, src/ezstream.c: - Ignore SIGPIPE, which turned out to be the cause for silent - deaths of long- running ezstream processes. - -2007-11-04 14:34 moritz - - * [r14101] configure.in, win32/config.h: - Post-release version bump. - -2007-11-04 13:52 moritz - - * [r14097] ChangeLog: - Sync. - -2007-11-04 13:50 moritz - - * [r14096] NEWS: - Today is release day, finally. - -2007-11-04 13:43 moritz - - * [r14095] NEWS: - Sync. - -2007-11-04 13:40 moritz - - * [r14094] examples/Makefile.am, - examples/ezstream_reencode_mp3.xml, - examples/ezstream_reencode_theora.xml, - examples/ezstream_reencode_vorbis.xml, - examples/ezstream_reencoding_example_mp3.xml, - examples/ezstream_reencoding_example_theora.xml, - examples/ezstream_reencoding_example_vorbis.xml, - examples/ezstream_stdin_vorbis.xml: - * Add new configuration example for streaming from standard - input. * Rename reencoding examples to shorter and less redundant - filenames. - -2007-11-04 13:09 moritz - - * [r14093] examples/ezstream_reencoding_example_mp3.xml, - examples/ezstream_reencoding_example_theora.xml, - examples/ezstream_reencoding_example_vorbis.xml: - Improve the reencoding examples; more usable defaults and add - more options to create a more well-defined stream of raw samples. - -2007-10-18 07:39 moritz - - * [r14010] NEWS: - Sync. - -2007-10-18 07:39 moritz - - * [r14009] src/ezstream.c: - Improve output messages some more when dealing with standard - input. - -2007-10-18 06:38 moritz - - * [r14008] src/xalloc.c: - Wow, now how did that one creep in an remain undetected for so - long? - -2007-10-16 14:51 moritz - - * [r14000] NEWS: - Update. - -2007-10-16 14:51 moritz - - * [r13999] src/ezstream.c: - This needs changin' as well. - -2007-10-16 14:46 moritz - - * [r13998] src/ezstream.c: - Fix use of yet another uninitialized-if-streaming-from-stdin - variable. This prevents bogus output in the "real-time" status - line. - -2007-10-16 14:44 moritz - - * [r13997] src/ezstream.c: - Return a proper error message when there's no more data to read - from standard input. - -2007-10-16 14:28 moritz - - * [r13996] src/ezstream.c: - Ticket #1247: Don't dereference uninitialized junk pointers; this - fixes a crash when streaming standard input without also using a - metadata program (d'oh.) - -2007-09-16 12:50 moritz - - * [r13840] NEWS: - Post-release tweak: Add Ticket number. - -2007-09-16 12:49 moritz - - * [r13839] configure.in, win32/config.h: - Bump version number after the 0.5.1 release. - -2007-09-16 12:23 moritz - - * [r13835] ChangeLog: - Sync. - -2007-09-16 12:20 moritz - - * [r13834] NEWS: - 0.5.1 will be released today. - -2007-09-14 07:01 moritz - - * [r13803] NEWS: - Update. - -2007-09-14 07:01 moritz - - * [r13802] src/ezstream.c: - Warn, in verbose mode, when dealing with empty playlists. - -2007-09-14 07:00 moritz - - * [r13801] src/playlist.c: - In this case, the pl->num check is superfluous. - -2007-09-14 06:59 moritz - - * [r13800] src/playlist.c: - If there are no playlist entries, dereferencing pl->list causes a - segfault. Fix this by checking pl->num early. - -2007-08-31 17:19 moritz - - * [r13678] configure.in, win32/config.h: - Bump version number after the 0.5.0 release. - -2007-08-31 16:22 moritz - - * [r13672] ChangeLog: - Sync. - -2007-08-31 16:02 moritz - - * [r13671] configure.in: - -Wno-unused-parameter breaks gcc2, remove it. - -2007-08-31 15:55 moritz - - * [r13670] configure.in: - Try harder to link against TagLib. - -2007-08-31 11:49 moritz - - * [r13669] NEWS: - Today is release day. - -2007-08-31 11:47 moritz - - * [r13668] NEWS, configure.in, src/compat.h, src/ezstream.c, - src/util.c, src/util.h, win32/config.h: - gettimeofday() everywhere; now ezstream behaves almost the same - on Windows compared to Unix. Also mention TagLib support on - Windows in NEWS. - -2007-08-31 11:46 moritz - - * [r13667] src/compat.c: - Fake the location of my basename() source to be more clear. - -2007-08-31 01:59 moritz - - * [r13665] win32/README.win32: - Having TagLib on Windows means that reading metadata from files - should work like elsewhere now. While here, do some minor - tweaking as well. - -2007-08-31 01:48 moritz - - * [r13664] win32/ezstream.sln, win32/ezstream.vcproj: - ezstream.exe is now using TagLib as well. - -2007-08-30 18:36 moritz - - * [r13662] win32/README.win32: - Tweak, sync with what will be the new reality soon, and include - COPYING.txt in the future. - -2007-08-30 12:27 moritz - - * [r13660] NEWS: - Document a few extra nits that also happened so far. - -2007-08-30 12:13 moritz - - * [r13659] doc/ezstream.1.in: - Sync with new reality, and fix a completely botched up sentence. - -2007-08-30 11:31 moritz - - * [r13658] src/ezstream.c, src/util.c, src/util.h: - * Back out conversions to ISO8859-1. * Add 'charset=UTF-8' to the - metadata update query arguments. The current release of Icecast - will ignore it, and the next one will know how to handle it - (karl@ is still working on it at this point, but previous diffs - worked as advertised.) * If no metadata format string is - available and we have both an artist and a title, use the - artist/title way of updating instead of the generic "song" - interface. - -2007-08-26 14:31 moritz - - * [r13632] configure.in: - When configure found libiconv, it helps to also have it use that - information to properly link against it. Problem spotted and fix - tested by iCER on #icecast. - -2007-08-25 15:07 moritz - - * [r13627] doc/ezstream.1.in: - Expand the "Metadata Caveats" subsection wrt codesets and actual - abilities of ezstream and Icecast. - -2007-08-25 14:37 moritz - - * [r13626] src/util.c: - Need to consider converting from an unknown/unsupported codeset - as well. - -2007-08-25 14:16 moritz - - * [r13624] src/util.c: - Whoops. Fix error message ... - -2007-08-25 12:24 moritz - - * [r13622] src/ezstream.c, src/metadata.c, src/util.c, src/util.h: - Get closer to what Icecast does (or will) expect wrt used - codesets. I still disagree with the new ISO-8859-1 assumption for - non-Ogg streams, because (for example) with ID3 tags, a codeset - is simply not part of the specification and a better assumption - would be that they are in the user's locale. Therefore, it would - make more sense, IMO, to clearly specify that ANY metadata sent - to Icecast should be UTF-8 and let the source client figure out - the rest. This would also answer the question what codeset an - /admin user should use if the content type of a mountpoint isn't - known (although that can be figured out with an unclean read of - the mountpoint's stats beforehand.) - -2007-08-24 17:23 moritz - - * [r13616] src/util.c: - Less code is always better. - -2007-08-24 12:37 moritz - - * [r13611] README: - Mention optional iconv() dependency. - -2007-08-24 12:09 moritz - - * [r13610] NEWS: - Add ticket no. to the MP3 metadata fix. - -2007-08-24 11:57 moritz - - * [r13609] NEWS, configure.in, doc/ezstream.1.in, src/ezstream.c, - src/metadata.c, src/util.c, win32/config.h, - win32/ezstream.vcproj: - UTF-8 support is now ready to be used. - -2007-08-24 00:52 moritz - - * [r13607] ., Makefile.am, build-aux, build-aux/Makefile.am, - build-aux/config.rpath, configure.in, m4/iconv.m4, src/util.c, - src/util.h: - Work in progress: Proper UTF-8 support that doesn't affect - console output. No new code is actually used, yet, as there's - still more work to be done. This adds the whole iconv-related - build stuff and moves most auto* files into build-aux/. - -2007-08-24 00:46 moritz - - * [r13606] src/metadata.c: - Fix native ID3v1 reading (no-op, since affected fields were not - used.) - -2007-08-23 13:48 moritz - - * [r13592] src/ezstream.c: - Change the MP3 special case, so working with metadata is more - flexible. Turns out that there is still a problem with MP3 - streams that are being reencoded. This allows me to try out more - solutions. - -2007-08-22 18:29 moritz - - * [r13589] NEWS: - Consistency + typo fix. - -2007-08-22 15:19 moritz - - * [r13587] doc/ezstream.1.in, src/ezstream.c: - The -c parameter is not optional. - -2007-08-22 15:15 moritz - - * [r13586] src/ezstream.c, src/util.c, src/util.h: - Make main() smaller by moving the libshout setup into a separate - function. - -2007-08-14 04:10 moritz - - * [r13546] win32/config.h: - Bump version numbers here, too. - -2007-08-14 04:08 moritz - - * [r13545] NEWS: - Sync. - -2007-08-14 03:43 moritz - - * [r13544] doc/ezstream.1.in, src/ezstream.c, src/metadata.c, - src/metadata.h: - Ticket #1225, reported by matpoc at lenta dot ru: Looks like - there's demand for normalizing metadata strings, which -- I - assume -- is due to strange (MP3) encoders that do weird things. - Well, why not. It's not too intrusive, and disabled by default. - Enable string normalization with the new -n command line - parameter. - -2007-08-14 03:33 moritz - - * [r13543] configure.in: - Bump to 0.5.0, new feature coming up. - -2007-08-14 03:32 moritz - - * [r13542] src/ezstream.c, src/util.c, src/util.h: - Ticket #1225, reported by matpoc at lenta dot ru: Bring back - special case for streaming MP3 files without reencoding, which - was lost during the many changes in 0.3.0 and subsequently - forgotten. Sorry for the inconvenience, and thanks for the - report. - -2007-08-09 11:13 moritz - - * [r13494] win32/ezstream.sln, win32/ezstream.vcproj: - More build tweaks. The only thing that still doesn't work by now - is building a static, thread-safe libshout. Bugger all, this can - wait until if/when I need threads. - -2007-08-08 21:52 moritz - - * [r13467] src/playlist.c: - Since playlist_t is using size_t, change two unsigned longs to - size_t as well. - -2007-08-08 21:33 moritz - - * [r13466] win32/config.h, win32/ezstream.sln, - win32/ezstream.vcproj: - More Win32 project and build cleanups. - -2007-08-08 14:21 moritz - - * [r13464] win32/ezstream.sln, win32/ezstream.vcproj: - Reorder project list and add xalloc.* to the build. - -2007-08-08 14:20 moritz - - * [r13463] src/ezstream.c, win32/config.h: - WIN32 #ifdef reduction. - -2007-08-08 13:46 moritz - - * [r13462] configure.in: - A few tweaks: * Get ISO C99 from the compiler, if possible. * - Check for ssize_t for --enable-debug portability. * Add - AC_C_VOLATILE check, because we use it. - -2007-08-08 13:25 moritz - - * [r13461] win32/config.h: - Damn, it looks like I forgot to update this for the Win32 builds - ... - -2007-08-08 13:24 moritz - - * [r13460] src/xalloc.c: - Sync. - -2007-08-08 13:15 moritz - - * [r13458] src/ezstream.c: - Rename shutdown() to ez_shutdown() to prevent a function name - clash on Windows. - -2007-08-08 13:04 moritz - - * [r13457] src/metadata.c, src/playlist.c: - Use a better \n and \r trimming idiom after fgets(). - -2007-08-04 17:24 moritz - - * [r13443] src/xalloc.c, src/xalloc.h: - It's good to know how to spell the own email address. - -2007-08-04 17:10 moritz - - * [r13441] src/xalloc.c: - Merge. - -2007-08-04 17:10 moritz - - * [r13440] src/playlist.c: - Sprinkle in some consistency ... - -2007-08-04 17:04 moritz - - * [r13438] src/configfile.c, src/configfile.h, src/ezstream.c: - Do a clean shutdown on SIGINT and SIGTERM. - -2007-08-04 16:46 moritz - - * [r13437] src/xalloc.c, src/xalloc.h: - Merge xalloc changes. - -2007-08-04 16:39 moritz - - * [r13436] src/ezstream.c, src/metadata.c, src/playlist.c: - Now that xalloc is pretty much an external entity, explicitly set - freed pointers to NULL if we lateron expect them to be NULL (no - longer rely on xalloc to do this for us.) - -2007-08-04 16:09 moritz - - * [r13433] src/metadata.c: - Do not xfree() something that wasn't x*alloc()'ed. - -2007-08-02 18:50 moritz - - * [r13432] configure.in: - Make PACKAGE_BUGREPORT point to the bug tracker URI. - -2007-08-02 18:48 moritz - - * [r13431] Makefile.am, NEWS, README, compat, compat/Makefile.am, - compat/sys, compat/sys/Makefile.am, compat/sys/tree.3, - compat/sys/tree.h, configure.in, src/Makefile.am, - src/configfile.c, src/ezstream.c, src/metadata.c, src/playlist.c, - src/util.c, src/util.h, src/xalloc.c, src/xalloc.h: - Switch to using the (integrated) libxalloc. - -2007-07-24 15:29 moritz - - * [r13304] src/ezstream.c, src/metadata.c: - Cosmetic changes; no functional change. Use the calloc()-style - API correctly. - -2007-07-24 15:13 moritz - - * [r13303] src/util.c: - Cosmetic changes. No functional change. - -2007-07-24 13:44 moritz - - * [r13302] configure.in: - Bump version number after the 0.4.3 release. - -2007-07-24 13:21 moritz - - * [r13298] ChangeLog: - Sync. - -2007-07-24 13:20 moritz - - * [r13297] NEWS: - Another bugfix, another 0.4.x release. - -2007-07-24 13:04 moritz - - * [r13296] src/ezstream.c: - Fix the dang file descriptor leak of < 0.4.1 for good; the old - fix only took care of it partially. Diagnosed with the help from - someone, who wishes to stay anonymous. Thanks! - -2007-07-17 15:16 moritz - - * [r13279] configure.in: - Bump the version number after the 0.4.2 release. - -2007-07-17 14:47 moritz - - * [r13275] ChangeLog: - Sync - -2007-07-17 14:45 moritz - - * [r13274] NEWS: - Get this out the door today, no need to hold back. - -2007-07-16 00:32 moritz - - * [r13272] NEWS, src/ezstream.c: - D'oh! Make work with playlists as well. Problem - description found in the Icecast mailing list archive, in a mail - by Geoff Shang, via Google. Let's hope that the bug tracker - prevents this kind of bug hunting in the future ... - -2007-07-15 19:16 moritz - - * [r13270] win32/README.win32: - Provide a pointer to the home page to Windows users. - -2007-07-15 19:11 moritz - - * [r13269] configure.in: - Bump version number after the 0.4.1 release. - -2007-07-15 16:38 moritz - - * [r13265] ChangeLog: - Update. - -2007-07-15 16:37 moritz - - * [r13264] NEWS: - This will be released today. - -2007-07-14 01:32 moritz - - * [r13259] COPYING, doc/ezstream.1.in, src/compat.c, src/compat.h, - src/configfile.c, src/configfile.h, src/ezstream.c, - src/metadata.c, src/metadata.h, src/playlist.c, src/playlist.h, - src/util.c, src/util.h: - Change my email address to the new one. - -2007-07-14 01:27 moritz - - * [r13258] NEWS: - Update. - -2007-07-14 01:20 moritz - - * [r13257] src/ezstream.c: - Plug an fd leak, triggered by using -q. - -2007-07-13 10:45 moritz - - * [r13253] README: - Spelingk, and fmt -78. - -2007-07-13 10:30 moritz - - * [r13252] doc/ezstream.1.in: - Spelink. - -2007-03-11 05:17 moritz - - * [r12724] configure.in, win32/config.h: - Bump version number after the 0.4.0 release. - -2007-03-11 05:04 moritz - - * [r12720] ChangeLog: - sync - -2007-03-11 04:39 moritz - - * [r12719] NEWS: - Release coming up today. - -2007-03-11 03:49 moritz - - * [r12718] NEWS: - fixes - -2007-03-11 00:28 moritz - - * [r12717] src/metadata.c: - Make this build on Windows and not segfault the MIPSpro C - compiler version <7.2. - -2007-03-11 00:02 moritz - - * [r12716] doc/ezstream.1.in: - Formatting improvements, and some minor rewording. - -2007-03-10 23:36 moritz - - * [r12715] win32/Makefile.am: - Missed a conf -> examples change here. - -2007-03-10 23:28 moritz - - * [r12714] src/metadata.c: - taglib_file_audioproperties returns const - -2007-03-10 22:44 moritz - - * [r12713] src/metadata.c: - Remove unreachable statement. - -2007-03-10 21:23 moritz - - * [r12712] NEWS, src/metadata.c, src/playlist.c: - Do not execute group-/world-writeable playlist and metadata - scripts. - -2007-03-10 21:18 moritz - - * [r12711] NEWS, src/ezstream.c, src/metadata.c, src/metadata.h: - Include the total playing time of a song in the "real-time" - output, if TagLib supplies it. - -2007-03-10 20:13 moritz - - * [r12710] Makefile.am, conf, configure.in, examples, - examples/Makefile.am, examples/ezstream_metadata.xml, - examples/ezstream_mp3.xml, - examples/ezstream_reencoding_example_mp3.xml, - examples/ezstream_reencoding_example_theora.xml, - examples/ezstream_reencoding_example_vorbis.xml, - examples/ezstream_vorbis.xml, examples/meta.sh, examples/play.sh, - win32/README.win32: - Move conf/ to examples/. Add ezstream_metadata.xml and two - minimalistic example scripts. - -2007-03-10 19:03 moritz - - * [r12707] NEWS, doc/ezstream.1.in, src/configfile.c, - src/configfile.h, src/ezstream.c, src/metadata.c, src/metadata.h: - More metadata featuritis, add and implement - support for '@a@', '@t@' and '@s@'. - -2007-03-10 02:27 moritz - - * [r12701] src/configfile.c, src/configfile.h, src/ezstream.c, - src/metadata.c, src/metadata.h: - Commit work-in-progress towards more fine-grained control over - metadata. This has not been checked for changes to previous - behavior and isn't complete, yet. More to come. - -2007-03-09 13:43 moritz - - * [r12698] Makefile.am, src/ezstream.c, win32/Makefile.am, - win32/README.win32: - Various tweakings, and sync Win32 README with new reality. - -2007-03-09 02:30 moritz - - * [r12693] NEWS, doc/ezstream.1.in, src/configfile.c, - src/configfile.h, src/ezstream.c, src/metadata.c, src/metadata.h: - Add new configuration option, which specifies - an external program/script to get metadata from. Also include - SIGUSR2 handling that triggers metadata updates from the external - program mid-stream. - -2007-03-09 02:24 moritz - - * [r12692] src/playlist.c: - Squash a bug that I introduced a few hours ago ... - -2007-03-09 01:52 moritz - - * [r12691] Makefile.am: - Commit forgotten /Makefile.am change (new regen-win32: target). - -2007-03-09 01:49 moritz - - * [r12690] NEWS: - sync - -2007-03-09 01:49 moritz - - * [r12689] win32/Makefile.am, win32/ezstream.1.html: - Kill off the ugly HTML page. Replace with a regen-win32: target - in Makefile.am that automatically generates a PDF version of the - current man page (PDF not included in the source tarball.) - -2007-03-09 01:44 moritz - - * [r12688] win32/README.win32: - Update with blurp about limited functionality. - -2007-03-08 21:38 moritz - - * [r12686] src/ezstream.c, src/playlist.c: - Shrink buffers to PATH_MAX. - -2007-03-08 20:59 moritz - - * [r12685] src/ezstream.c, src/playlist.c, src/playlist.h: - Fix playlist_free() as well ... - -2007-03-08 20:24 moritz - - * [r12684] NEWS, README, configure.in, src/Makefile.am, - src/metadata.c: - Working TagLib support (optional.) - -2007-03-08 19:46 moritz - - * [r12683] src/compat.h: - Define SIZE_T_MAX to the real maximum of size_t. - -2007-03-08 19:45 moritz - - * [r12682] win32/ezstream.vcproj: - sync - -2007-03-08 15:25 moritz - - * [r12681] src/ezstream.c, src/metadata.c, src/metadata.h: - Hmph. I've been stepping into the copy-of-pointer trap twice now. - Fix it again. - -2007-03-08 14:39 moritz - - * [r12680] configure.in, src/Makefile.am, src/ezstream.c, - src/metadata.c, src/metadata.h: - Iterate towards optional TagLib support, as well as scripted - metadata support. This is just the first step and equivalent to - current functionality. - -2007-03-08 14:36 moritz - - * [r12679] configure.in, win32/config.h: - New features coming up, bump version to 0.4.0 - -2007-03-08 14:34 moritz - - * [r12678] NEWS: - sync - -2007-03-08 01:12 moritz - - * [r12677] src/util.c, src/util.h: - Replace the very broken xfree() function with an xfree() macro - - the main point was to set ptr to NULL, but the function only set - the copy of ptr to NULL. Spotted by Karl Heyes, thanks a lot! - -2007-03-07 23:39 moritz - - * [r12676] src/playlist.c: - Remove redundant code since the switch to xfree(). - -2007-03-07 21:01 moritz - - * [r12673] src/Makefile.am, src/compat.c, src/compat.h, - src/configfile.c, src/ezstream.c, src/playlist.c, src/util.c, - src/util.h, win32/ezstream.vcproj: - More code reorganization, move compatibility and utility - functions out of ezstream.c. Use a basename() function for - Windows that behaves identical to a modern Unix' basename(). - -2007-03-07 12:53 moritz - - * [r12672] src/configfile.c: - cosmetics - -2007-03-06 14:11 moritz - - * [r12666] ., conf, doc, m4, src, win32: - Ignore generated files. - -2007-03-06 14:02 moritz - - * [r12665] configure.in, win32/config.h: - Bump version number after the 0.3.0 release. - -2007-03-05 02:03 moritz - - * [r12639] ChangeLog: - regen - -2007-03-05 01:01 moritz - - * [r12637] win32/ezstream.1.html: - regen - -2007-03-05 00:51 moritz - - * [r12636] doc/ezstream.1.in: - Fix a typo, and reword a few sentences to make them easier to - understand. - -2007-03-04 23:58 moritz - - * [r12635] NEWS: - Add release date. This is definitely going out today... - -2007-03-04 21:19 moritz - - * [r12634] ChangeLog: - regen - -2007-03-04 21:12 moritz - - * [r12633] README: - Sync with the blurb on the new home page. - -2007-03-04 15:59 moritz - - * [r12630] src/configfile.c: - Fix logic error and prevent an endless loop on error(s) in the - config file. - -2007-03-04 15:50 moritz - - * [r12629] src/playlist.c: - While rand() being crappy is true for most/all *nix systems, on - Windows, this is different. The shifting severely screwed up its - randomness. Just leave it away and systems that only have a bad - version of rand() will have to just deal with it. - -2007-03-04 15:16 moritz - - * [r12628] COPYING, NEWS, src/configfile.c, src/ezstream.c, - win32/README.win32: - More pre-release maintenance. - -2007-03-04 14:29 moritz - - * [r12627] win32/Makefile.am, win32/README.win32, win32/config.h, - win32/ezstream.1.html, win32/ezstream.sln, win32/ezstream.vcproj: - Yay. I finally managed to build a statically linked and - self-contained ezstream.exe. Update, and regen the HTML man page - for -V. - -2007-03-04 14:27 moritz - - * [r12626] doc/ezstream.1.in, src/ezstream.c: - Add -V command line parameter to print the version number and - exit. - -2007-03-03 20:20 moritz - - * [r12621] win32/Makefile.am, win32/README.win32, - win32/ezstream.1.html, win32/ezstream.sln, win32/ezstream.vcproj: - More, rather evil Windows stuff. This is about as far as I'm - willing to go for now. Volunteers willing to take all this - Windows stuff off my hands are very welcome. ;-) - -2007-03-03 20:17 moritz - - * [r12620] src/compat.h, src/configfile.c, src/ezstream.c, - src/strtonum.c: - Some more cosmetic tweaks. - -2007-03-03 17:50 moritz - - * [r12617] src/ezstream.c: - Forgot one PATH_SEPARATOR instance ... - -2007-03-03 17:48 moritz - - * [r12616] src/ezstream.c: - Use size_t in strrcmp(). - -2007-03-03 16:13 moritz - - * [r12615] src/Makefile.am, src/compat.h, src/ezstream.c, - src/playlist.c, win32/Makefile.am, win32/ezstream.dsp, - win32/ezstream.dsw, win32/ezstream.iss, win32/ezstream.sln, - win32/ezstream.vcproj: - Iterate back towards working Windows support. - -2007-03-03 12:42 moritz - - * [r12614] src/ezstream.c: - STDERR_FILENO -> fileno(stderr), and fix a brain'o: Systems with - limited or no signals support obviously don't have - SIG_HUP/SIG_USR1 defined. - -2007-03-02 12:52 moritz - - * [r12603] configure.in, src/Makefile.am, src/configfile.c, - src/ezstream.c, src/strfctns.h, src/strlcat.c, src/strlcpy.c, - src/strlfctns.h, src/strtonum.c: - Improve string to integer conversion stuff, and have another stab - at the config file parsing. Ezstream now prints each error it can - find and then bails out, instead of bailing out on the first - error. Tweak URL parsing as well, and do some cosmetic changes to - the error messages. - -2007-03-02 00:57 moritz - - * [r12599] NEWS, doc/ezstream.1.in, src/configfile.c, - src/configfile.h, src/ezstream.c: - Allow users to restrict the number of reconnection attempts. This - also changes how reconnections are handled in general: A - recovered connection always skips to the next tune as well, as it - seems that at least for Ogg Vorbis, libshout wants to see an Ogg - header after a shout_open(). The new code makes this behavior - consistent among all formats. - -2007-03-01 14:50 moritz - - * [r12597] configure.in, src/ezstream.c, src/playlist.c, - src/strlcat.c, src/strlcpy.c, src/util.c: - Enable more warnings on gcc, and do some miscellaneous cleanups. - -2007-03-01 01:22 moritz - - * [r12596] src/ezstream.c: - Redirect only de-/encoder screen output to /dev/null with -q, and - restore standard error outside that popen() call. - -2007-03-01 00:34 moritz - - * [r12595] m4/shout.m4: - Tweak XXX comment. - -2007-03-01 00:10 moritz - - * [r12594] README, configure.in: - Make the example configuration files directory configurable. - -2007-02-28 21:48 moritz - - * [r12592] NEWS, conf/ezstream_mp3.xml, conf/ezstream_vorbis.xml, - doc/ezstream.1.in, src/configfile.c, src/configfile.h, - src/ezstream.c: - Add new configuration option for disabling - continuous streaming. - -2007-02-28 21:26 moritz - - * [r12591] NEWS, conf/ezstream_reencoding_example_mp3.xml, - conf/ezstream_reencoding_example_vorbis.xml, doc/ezstream.1.in, - src/configfile.c, src/configfile.h, src/ezstream.c, - src/playlist.c, src/playlist.h: - Add new playlist scripting feature (works similar to Ices 2.x.) - -2007-02-28 15:35 moritz - - * [r12590] configure.in, src/ezstream.c: - Replace geteuid() check with stat(), and make it an error if the - configuration file is group or world writeable. This is actually - what the warning about root was all about. - -2007-02-28 13:53 moritz - - * [r12589] src/Makefile.am, src/ezsignals.h, src/ezstream.c: - Back out hardly used ezsignals.h. - -2007-02-28 12:47 moritz - - * [r12588] NEWS: - Remove redundant paragraph. - -2007-02-28 12:44 moritz - - * [r12587] CHANGELOG, ChangeLog, Makefile.am, NEWS, mkcl.sh: - Make a more standard distribution: Rename CHANGELOG to NEWS, - bring back the complete ChangeLog and add mkcl.sh that contains - the options to generate ChangeLog. - -2007-02-28 11:06 moritz - - * [r12586] CHANGELOG, ChangeLog, Makefile.am: - Switch from a generated ChangeLog to a manually maintained and - more compact CHANGELOG. - -2007-02-28 11:03 moritz - - * [r12585] src/ezstream.c: - Sync usageHelp() with new reality. - -2007-02-27 14:44 moritz - - * [r12576] configure.in: - Let MIPS[pro] C be chatty with warnings and check for basename() - in libgen. Ezstream now builds on IRIX. - -2007-02-27 14:42 moritz - - * [r12575] src/ezstream.c: - getopt() returns int, not char. - -2007-02-27 14:41 moritz - - * [r12574] m4/xiph_xml2.m4: - Use backticks to execute xml2-config/xslt-config, which is more - portable. - -2007-02-27 12:46 moritz - - * [r12573] README: - Document a caveat when building ezstream on Solaris with a - different compiler than the one used to build libshout. - -2007-02-26 20:29 moritz - - * [r12572] configure.in, m4/shout.m4: - Make this work on static archs, and get one step closer to SunCC - support on Solaris. Also, don't complain if libshout isn't - thread-safe, as Ezstream isn't multithreaded. - -2007-02-26 19:59 moritz - - * [r12571] Makefile.am, configure.in, m4/Makefile.am: - Add m4/ to the distribution tarball. - -2007-02-26 15:28 moritz - - * [r12570] Makefile.am, m4/ogg.m4, m4/vorbis.m4: - Unbreak "make distcheck": $prefix is not a good default, use - /usr/local instead. This makes it more likely that installed - libogg and libvorbis are found, when the user (or autoconf) - specifies a different --prefix. Users who installed their - libraries in their homedir now have to set $OGG_PREFIX and - $VORBIS_PREFIX, or set their respective --with arguments. Let the - snapshot target use distcheck now that it works. - -2007-02-26 02:56 moritz - - * [r12565] m4/ac_config_libconfig_in.m4, m4/acx_pthread.m4, - m4/ogg.m4, m4/shout.m4, m4/vorbis.m4, m4/xiph_compiler.m4, - m4/xiph_curl.m4, m4/xiph_net.m4, m4/xiph_path_python.m4, - m4/xiph_types.m4, m4/xiph_xml2.m4: - Remove unused .m4 files and sync the used ones with Icecast. - -2007-02-25 18:28 moritz - - * [r12564] src/ezstream.c: - Make Ezstream work properly and do the right thing, even when - bombarded with a flurry of simultaneous SIGHUP and SIGUSR1 - signals. From what I can tell, signal handling is now quite solid - now. Achieve this by moving most of streamFile() into a new - sendStream() function, which is called within a new do-while loop - inside streamFile(). There, proper behavior is ensured and a race - condition resolved in favor of SIGHUP. - -2007-02-25 16:00 moritz - - * [r12563] src/ezstream.c: - Switch from using signal() to sigaction() and friends, so that - SA_RESTART can be used. This is required for Solaris and possibly - others, where signal handlers have to be reinstalled after having - caught one signal via signal(). Also prevent Ezstream from being - killed by a handled signal in streamFile(), where they can - interrupt fread()'s system calls. This improves matters, but - isn't perfect, yet. A SIGHUP signal can still cause skipping to - the next track, which should be triggered only by SIGUSR1. - -2007-02-25 14:00 moritz - - * [r12562] Makefile.am, conf/Makefile.am, configure.in, - src/Makefile.am, src/configfile.c, src/configfile.h, - src/ezstream.c, win32/Makefile.am: - Various cleanups and auto-fu tweaks. * Make Makefile.am files - look alike as much as possible. * Remove debug: target and don't - mess with the users DEBUG environment variable: Autoconf checks - for -g and automatically adds it to CFLAGS, which is overridden - by the user's $DEBUG. If the user didn't specify one, "make - install" will strip the resulting binaries and leave the - debugging symbols intact otherwise. * Remove profile: target, as - it is quite pointless in Ezstream. Also, the user can add - profiling flags via the $DEBUG variable as well. * Remove - -ffast-math and -fsigned-char from gcc, and enable two additional - warnings instead. * Unconfuse Solaris compiler flags - (unfortunately, the configure script still fails in the libshout - check with some obscure linker error): Do not force -x04 and - -fast optimizations, let the user decide (it doesn't matter for - Ezstream anyways.) Remove -xgc92, which is deprecated and - actually makes the resulting binary run slower on SPARC. Also - remove -fsimple, which does not help and has the potential of - causing trouble, and don't enable verbose warnings just to - disable them afterwards with -w. Leave only -v for verbose - warnings. * Const'ify getFormat*() functions and blankString, and - squelch a few const- related warnings. * Squelch a signedness - warning and fix two ;; syntax errors. * Add a snapshot target to - Makefile.am that creates a tarball of the form - ezstream-snapshot-YYYYMMDD.tar.gz. - -2007-02-25 03:49 moritz - - * [r12557] src/ezstream.c: - Merge changes to the remaining two functions, openResource() and - streamFile(), after which the merge is complete. Changes in - openResource(): * Let the caller know whether we're streaming - from standard input, and give it a copy of the metadata - information. * Make filename extension matching case insensitive. - Ezstream can now stream foo.Ogg out of playlist.tXt. (On that - note, another item from the parseConfig() commit log message was - missing: and are also case insensitive now.) - Changes in streamFile(): * New feature: Skip currently playing - track when receiving SIGUSR1. * New feature: When using both the - new -q and -v command line parameters, Ezstream now displays some - "real-time" information: playlist position, elapsed time - streaming the current track, and approximate bitrate in kbps. * - Fix the fread() loop by moving the "if read bytes > 0" condition - into the while statement, and check with ferror() afterwards - whether an error occured. * Remove redundant shout_delay() call. - Ezstream puts itself to sleep with shout_sync(). * Return a value - that makes sense in main()'s do-while loop, instead of whatever - shout_send() returned last. * Remove or prettify a few messages. - -2007-02-25 03:10 moritz - - * [r12554] src/ezstream.c: - Merge processMetadata() changes: * Fix how the metadata string is - generated. Don't include the " - " in the output if either artist - or title are missing from ID3v1/Vorbis tags. * Print the correct - error message when ov_open() fails. * Improve filename-based - generation of metadata. Use a copy of fileName for basename(), - which may modify its argument in some places where the old, weird - POSIX implementation is used. Also, basename() is not infallible, - but when it fails, it is annoying for us. Assert that it cannot - fail since we feed it with path names < PATH_MAX (handled in - playlist.c and configfile.c.) In short, make processMetadata() - always return something more or less useful as long as the file - in question can be opened. - -2007-02-25 02:36 moritz - - * [r12553] src/ezstream.c: - Merge changes to replaceString() and buildCommandString(), and do - the formatting nitpickery to setMetadata(). Changes in - replaceString(): * Fix a heap overflow. replaceString() would - happily replace multiple '@T@' and '@M@' placeholders and write - into *dest until things blow up. Fix this by using safe string - functions. Then completely prevent it by ensuring that it - replaces only one placeholder per call (adjusting - buildCommandString() accordingly) and already complaining to the - user in parseConfig() about illegal, multiple placeholders in - their command lines. (That parseConfig() change was missing from - the commit log earlier.) In buildCommandString(): * Use xcalloc() - instead of malloc() and get rid of the now redundant memset() - calls. * Allow decoder command lines to contain the '@M@' - metadata placeholder. Useful for combined de-/encoders like - ffmpeg2theora. * Tweak message about "unsupported" format, which - used to be false in the case of Ogg Theora streams. * Plug - several memory leaks. * Don't print the "Executing command 'foo'" - message in this function. - -2007-02-25 01:14 moritz - - * [r12552] src/ezstream.c: - Merge changes to main(), urlParse() and streamPlaylist(). In - main(): * Install the signal handler as late as possible. * Add - new command line options: -v (verbose, use twice for even more - verbose output) and -q (quiet, redirect standard error output - from external de-/ encoders to /dev/null.) * It is now an error - to supply more than one -c parameter. This prevents unexpected - results. * Add a stern warning when ezstream is running as root. - Just Don't Do It. Leaving the configfile writeable to others by - accident could mean instant root compromise. * Before handing the - config file over to libxml, try to open it ourselves first. The - error message from strerror() is a lot more helpful than the - cryption I/O error printed by libxml. * Don't preallocate memory - for urlParse(). * Fix command line error messages, they seem to - be for a different program than Ezstream. * More terse libshout - error messages, just print which function failed. I consider - these errors of questionable value for an end user, but at least - a knowledgeable one will know instantly what went wrong. * Case - insensitive matching of playlist file extensions. * Print the - address, port and mountpoint that Ezstream is actually trying to - connect to, instead of what the user supplied. That should make - it easier to spot reasons for connect failures (e.g. typos.) - Changes in urlParse(): * Let urlParse() allocate memory for - hostname and mountpoint, as it knows how much memory is actually - required. * Fix a buffer overflow of the tmpPort buffer by adding - checks and using safe string functions. * Let the caller print an - error message, instead of having the same printf() twice in - urlParse(). The streamPlaylist() function has been rewritten to - use the new playlist_*() routines. Apart from the added playlist - shuffle feature no functional change. - -2007-02-25 00:35 moritz - - * [r12551] configure.in: - Add check for geteuid(), which is better than checking for WIN32. - -2007-02-25 00:25 moritz - - * [r12550] src/ezstream.c: - Begin merging ezstream.c changes. This first batch includes: * - License reference and various #include cleanups and additions - that are required later. * Add new usage() and usageHelp() - functions (which already contain what's to come.) Move them close - to main() where getopt() is called. * New signal handler, which - now no longer uses printf(). printf() is not safe to use in - signal handlers. Use volatile sig_atomic_t types instead of ints - as flags to set in the handler. * Formatting and const'ifying of - WIN32-basename() and strrcmp(). Rearrange them so that the actual - "worker functions" are grouped together. * Add function - prototypes for those that are already up-to-date. * Rename - ReplaceString() to replaceString() for consistency with other - function names in Ezstream. * Prepare for portable *__progname - usage. - -2007-02-24 23:26 moritz - - * [r12549] src/configfile.c: - Merge new parseConfig() function. There were many changes, but - those are too cumbersome to merge separately. They are: * The - usual formatting nitpickings. * Don't leak memory in case of - duplicate entries. Instead make it an error and print a helpful - error message, with config file line number, to the user. * - Replace the manual cast to (const xmlChar *) with libxml2's - BAD_CAST. There probably won't be any UTF8 support in Ezstream - any time soon ... * Remove redundant strlen() check - - xmlNodeListGetString() never returns an empty string if - (cur->xmlChildrenNode != NULL). * Use xstrdup() instead of - malloc() + memset() + strcpy(). * Ensure that boolean - configration options are always either 1 or 0. * Ensure that path - names given via do not exceed PATH_MAX. * Add - configuration option for playlist shuffling. - -2007-02-24 23:05 moritz - - * [r12548] src/configfile.c: - Add function to free a configuration in case of an error. - -2007-02-24 23:03 moritz - - * [r12547] configure.in: - Fix typo in comment. - -2007-02-24 22:56 moritz - - * [r12546] src/configfile.c: - Replace three if-conditionals with one, both in - getFormatEncoder() and getFormatDecoder(), with prettier - formatting. - -2007-02-24 22:50 moritz - - * [r12545] src/configfile.c, src/configfile.h: - Const'ify configfile functions. - -2007-02-24 22:25 moritz - - * [r12544] src/configfile.c, src/configfile.h: - Add license reference to configfile.c, sync #includes with what - will be required later, getEZConfig() formatting and remove - unused printConfig() function. - -2007-02-24 22:16 moritz - - * [r12543] src/configfile.h: - Begin merging configfile.* changes by cleaning up the .h file: - Add license reference, remove prototype of nonexistent - getMetadataGrabber() function, and do some formatting. - -2007-02-24 22:03 moritz - - * [r12542] win32/Makefile.am: - Clean core and backup files in this directory as well. Only ~2500 - lines of diffs left to merge. - -2007-02-24 22:01 moritz - - * [r12541] src/ezsignals.h: - Commit header with three macros that help with signal handling. - Will be actually used later. Now, all new files are in. - -2007-02-24 21:59 moritz - - * [r12540] configure.in: - Let the configure script set a (hard-coded, for now) examples - installation directory. This will be made configurable later. - -2007-02-24 21:50 moritz - - * [r12539] configure.in: - Add several checks that we need now, i.e. very soon. - -2007-02-24 21:46 moritz - - * [r12538] configure.in: - AM_CONFIG_HEADER -> AC_CONFIG_HEADERS, and move config.h into - src/. - -2007-02-24 21:44 moritz - - * [r12537] configure.in: - Autoconf 2.61 has a nice macro AC_USE_SYSTEM_EXTENSIONS. Use it, - depend on autoconf-2.61 for it and remove the annoying - _GNU_SOURCE and _XOPEN_SOURCE ... dung. Autoconf takes care of - this, and even checks for more useful stuff for us. - -2007-02-24 21:37 moritz - - * [r12536] configure.in: - Generate a Makefile in doc/, and switch to AC_CONFIG_FILES. - -2007-02-24 21:34 moritz - - * [r12535] configure.in: - Ezstream does not need libtool, so remove it. Remove other - redundant configure checks as well: AC_PROG_CC and AC_HEADER_STDC - are automatically checked in packages written in C, no need to do - it twice. This shaves a lot off configure runtime. - -2007-02-24 21:29 moritz - - * [r12534] configure.in: - Start to incrementally merge configure.in changes by simply - shuffling code around a bit. No functional change, yet. - -2007-02-24 21:19 moritz - - * [r12533] Makefile.am: - Hook up doc/ with the build, depend on automake 1.9 and remove - dist-zip for now. The latter will come back after testing on - Windows has been done. - -2007-02-24 21:16 moritz - - * [r12532] autogen.sh: - Replace the autogen behemoth with something much simpler. - AC_PREREQ and AUTOMAKE_OPTIONS already take care of version - checks. - -2007-02-24 21:12 moritz - - * [r12531] conf/Makefile.am, conf/ezstream_mp3.xml, - conf/ezstream_reencoding_example_mp3.xml, - conf/ezstream_reencoding_example_theora.xml, - conf/ezstream_reencoding_example_vorbis.xml, - conf/ezstream_vorbis.xml: - Clean up and install example configuration files. - -2007-02-24 21:11 moritz - - * [r12530] README: - Commit rewritten README file. - -2007-02-24 20:59 moritz - - * [r12529] AUTHORS: - Remove AUTHORS. Credits are in the man page. - -2007-02-24 20:58 moritz - - * [r12528] INSTALL: - Add INSTALL file for those not familiar with the configure+make - dance. From autoconf-2.61. - -2007-02-24 20:57 moritz - - * [r12527] src/Makefile.am, src/strlcat.c, src/strlcpy.c, - src/strlfctns.h: - Add files with safe strlc*() string functions, and hook all new - files into Makefile.am. Also let "make clean" clean up coredumps - and editor backup files. - -2007-02-24 20:52 moritz - - * [r12526] doc, doc/Makefile.am, doc/ezstream.1.in: - Add ezstream man page. - -2007-02-24 20:50 moritz - - * [r12525] src/playlist.c, src/playlist.h: - Add new playlist handling functions. - -2007-02-24 20:49 moritz - - * [r12524] src/util.c, src/util.h: - Add new utility functions, for memory management. These do The - Right Thing and never return NULL. - -2007-02-24 18:55 moritz - - * [r12521] configure.in: - Begin to incrementally merge my changes to Ezstream by bumping - the version number and shifting blame to me. This should keep - most of the history in my local CVS repository. There may be - temporary breakages where it doesn't build or package until I'm - done. - -2005-12-14 21:40 oddsock - - * [r10593] win32/Makefile.am: - forgot to add the inno setup installer to the dist - -2005-12-14 21:16 oddsock - - * [r10592] win32/ezstream.iss: - version bump - -2005-12-14 21:14 oddsock - - * [r10590] ChangeLog: - added changelog - -2005-12-14 21:13 oddsock - - * [r10589] conf/Makefile.am, configure.in, src/ezstream.c: - added some reconnect logic fixed a buffer overflow on large - id3tags use pclose for popen'd file handles - -2005-01-05 00:38 oddsock - - * [r8612] README, conf/ezstream_m3u.xml, conf/ezstream_mp3.xml, - conf/ezstream_reencoding_example.xml, - conf/ezstream_reencoding_example_mp3.xml, - conf/ezstream_reencoding_example_theora.xml, - conf/ezstream_reencoding_example_vorbis.xml, - conf/ezstream_vorbis.xml, configure.in, src/ezstream.c, - win32/ezstream.dsp, win32/ezstream.dsw, win32/ezstream.iss: - cleanup of config files fixed reencoding bug on win32 bump to - version 0.2.0 - -2004-12-22 01:49 oddsock - - * [r8519] src/ezstream.c: - add passthorough support for unknown types - -2004-07-19 03:48 oddsock - - * [r7171] src/configfile.c, win32/ezstream.dsp, win32/ezstream.iss: - some win32 compilation fixes - -2004-07-19 03:12 oddsock - - * [r7170] README, conf/Makefile.am, - conf/ezstream_reencoding_example.xml, configure.in, - src/configfile.c, src/configfile.h, src/ezstream.c, - win32/ezstream.dsp: - Added reencoding capabilities to ezstream. - -2004-07-16 04:02 oddsock - - * [r7152] win32/ezstream.dsp: - - -2004-07-12 19:13 oddsock - - * [r7103] src/configfile.c, src/configfile.h, src/ezstream.c: - support for theora streams - -2004-04-21 13:48 oddsock - - * [r6563] configure.in, src/.deps, src/ezstream.c: - added ability to send a signal (SIGHUP) which will re-read the - current playlist (m3u) that is being processed. When this - happens, ezstream will pick up from the last track that was - played. - -2004-02-02 04:56 oddsock - - * [r5806] README: - stdin now working :) - -2004-02-02 04:39 oddsock - - * [r5805] aclocal.m4, configure.in: - * version bump * remove unneeded file - -2004-02-02 04:37 oddsock - - * [r5804] src/ezstream.c, win32/ezstream.dsp, win32/ezstream.iss: - * set read mode to binary for stdin on win32 * add libXML to - project file * bump version number - -2004-01-30 17:19 oddsock - - * [r5800] ., AUTHORS, COPYING, Makefile.am, README, aclocal.m4, - autogen.sh, conf, conf/Makefile.am, conf/ezstream_m3u.xml, - conf/ezstream_mp3.xml, conf/ezstream_vorbis.xml, configure.in, - m4, m4/ac_config_libconfig_in.m4, m4/acx_pthread.m4, m4/ogg.m4, - m4/shout.m4, m4/vorbis.m4, m4/xiph_compiler.m4, m4/xiph_curl.m4, - m4/xiph_net.m4, m4/xiph_path_python.m4, m4/xiph_types.m4, - m4/xiph_xml2.m4, src, src/.deps, src/.deps/configfile.Po, - src/.deps/ezstream.Po, src/Makefile.am, src/configfile.c, - src/configfile.h, src/ezstream.c, src/getopt.c, src/getopt.h, - win32, win32/Makefile.am, win32/ezstream.dsp, win32/ezstream.dsw, - win32/ezstream.iss: - Initial revision - +For a complete history of ezstream, please refer to +https://git.xiph.org/?p=ezstream.git diff --git a/NEWS b/NEWS index a4656d1..6e66601 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,48 @@ +Changes in 0.6.0, released on 2015-01-18: + + * This release contains a SECURITY FIX for a command injection vulnerability + that was found and reported by Alexandre Rebert: + + The previous handling of metadata placeholders allowed for arbitrary shell + commands to be trivially injected and executed as the ezstream user, via + malicious media files. + + This vulnerability depends on both a configuration using metadata + placeholders and the user streaming media files from untrusted sources + without noticing `commands` or $(commands) in artist or title fields. + + While the group of actually affected users may be limited, all users are + advised to upgrade. + + * This release requires users to ADJUST their CONFIGURATION: + + To protect against the injection vulnerability above, metadata is now + properly quoted and escaped from the shell. This means that any extra + quoting must be removed from configuration files. + + Remove all quoting from metadata placeholders in and + commands, e.g. replace "@M@" with @M@, and "@T@" with @T@, etc. Without + these changes, stream metadata will look both wrong and the injection + vulnerability may be re-introduced. + + Configuration examples have been adjusted accordingly. + + * src/ezstream.c: + - [FIX] Prevent certain characters from being interpreted by the shell. + - [FIX] Prevent ezstream from entering an infinite loop when stopping to + send data to standard input. From gquintard. + (Ticket #2045) + * various: + - [NEW] Add new feature from Matthew Adams + (with minor changes plus documentation.) This allows for recurring + and custom metadata updates in between song changes via + . + - [NEW] Add new command line option `-m' to disable any active metadata + updates. Idea from Richard Thomas. + (Ticket #1620) + + + Changes in 0.5.6, released on 2009-08-31: * ezstream-file.sh: @@ -23,6 +68,7 @@ Changes in 0.5.6, released on 2009-08-31: - [NEW] Add a real-world example playlist script with logging feature. + Changes in 0.5.5, released on 2009-08-01: * win32/config.h: @@ -177,7 +223,7 @@ Changes in 0.4.0, released on 2007-03-11: program. * src/compat.c: - - [ADD] Implement a basename() function for Windows that behaves like the + - [NEW] Implement a basename() function for Windows that behaves like the ones used on Unix systems. * win32/: @@ -185,19 +231,19 @@ Changes in 0.4.0, released on 2007-03-11: distribution, and provide a much better PDF version instead. * various: - - [ADD] Allow ezstream to use TagLib for reading metadata from media + - [NEW] Allow ezstream to use TagLib for reading metadata from media files. TagLib (libtag_c) is now an optional dependency. - - [ADD] When built with TagLib support, include the song length in the + - [NEW] When built with TagLib support, include the song length in the "real-time" information line, if available. - - [ADD] New configuration option, which causes + - [NEW] New configuration option, which causes metadata to be read from the output of an external program or script. - - [ADD] New runtime control via the SIGUSR2 signal, which triggers reading + - [NEW] New runtime control via the SIGUSR2 signal, which triggers reading of fresh metadata information from (metadata is always read at song changes.) - - [ADD] New configuration option, to customize metadata + - [NEW] New configuration option, to customize metadata strings when used with the new feature. - - [ADD] New '@a@' and '@t@' placeholders for separate artist and title + - [NEW] New '@a@' and '@t@' placeholders for separate artist and title metadata in de-/encoder commands. diff --git a/README b/README index cb69d09..15080a4 100644 --- a/README +++ b/README @@ -40,7 +40,7 @@ Ezstream optionally uses: - For reading metadata from Ogg Vorbis files: * TagLib 1.x (1.4 or newer recommended, will be used via the libtag_c wrapper) - (http://developer.kde.org/~wheeler/taglib.html) + (https://taglib.github.io/) OR: * libvorbis 1.x (http://www.vorbis.com) @@ -48,7 +48,7 @@ Ezstream optionally uses: many additional media file types. - For basic non-ASCII charset support in metadata and filenames: * Libiconv, if iconv() is not available in the system libc. - (http://www.gnu.org/software/libiconv/) + (https://www.gnu.org/software/libiconv/) diff --git a/compat/sys/tree.3 b/compat/sys/tree.3 index ffb39ef..ead02ea 100644 --- a/compat/sys/tree.3 +++ b/compat/sys/tree.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tree.3,v 1.20 2009/01/28 12:22:48 stsp Exp $ +.\" $OpenBSD: tree.3,v 1.26 2014/09/08 01:27:55 schwarze Exp $ .\"/* .\" * Copyright 2002 Niels Provos .\" * All rights reserved. @@ -23,7 +23,7 @@ .\" * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" */ -.Dd $Mdocdate: January 28 2009 $ +.Dd $Mdocdate: September 8 2014 $ .Dt TREE 3 .Os .Sh NAME @@ -63,13 +63,15 @@ .Nm RB_RIGHT , .Nm RB_PARENT , .Nm RB_FOREACH , +.Nm RB_FOREACH_SAFE , .Nm RB_FOREACH_REVERSE , +.Nm RB_FOREACH_REVERSE_SAFE , .Nm RB_INIT , .Nm RB_INSERT , .Nm RB_REMOVE -.Nd "implementations of splay and red-black trees" +.Nd implementations of splay and red-black trees .Sh SYNOPSIS -.Fd #include +.In sys/tree.h .Pp .Fn SPLAY_PROTOTYPE "NAME" "TYPE" "FIELD" "CMP" .Fn SPLAY_GENERATE "NAME" "TYPE" "FIELD" "CMP" @@ -130,7 +132,9 @@ .Ft "struct TYPE *" .Fn RB_PARENT "struct TYPE *elm" "RB_ENTRY NAME" .Fn RB_FOREACH "VARNAME" "NAME" "RB_HEAD *head" +.Fn RB_FOREACH_SAFE "VARNAME" "NAME" "RB_HEAD *head" "TEMP_VARNAME" .Fn RB_FOREACH_REVERSE "VARNAME" "NAME" "RB_HEAD *head" +.Fn RB_FOREACH_REVERSE_SAFE "VARNAME" "NAME" "RB_HEAD *head" "TEMP_VARNAME" .Ft void .Fn RB_INIT "RB_HEAD *head" .Ft "struct TYPE *" @@ -258,6 +262,11 @@ The macro inserts the new element .Fa elm into the tree. +Upon success, +.Va NULL +is returned. +If a matching element already exists in the tree, the insertion is +aborted, and a pointer to the existing element is returned. .Pp The .Fn SPLAY_REMOVE @@ -265,6 +274,11 @@ macro removes the element .Fa elm from the tree pointed by .Fa head . +Upon success, a pointer to the removed element is returned. +.Va NULL +is returned if +.Fa elm +is not present in the tree. .Pp The .Fn SPLAY_FIND @@ -405,6 +419,9 @@ macro removes the element .Fa elm from the tree pointed by .Fa head . +.Fn RB_REMOVE +returns +.Fa elm . .Pp The .Fn RB_FIND @@ -443,6 +460,18 @@ macros: RB_FOREACH(np, NAME, &head) .Ed .Pp +The macros +.Fn RB_FOREACH_SAFE +and +.Fn RB_FOREACH_REVERSE_SAFE +traverse the tree referenced by head +in a forward or reverse direction respectively, +assigning each element in turn to np. +However, unlike their unsafe counterparts, +they permit both the removal of np +as well as freeing it from within the loop safely +without interfering with the traversal. +.Pp The .Fn RB_EMPTY macro should be used to check whether a red-black tree is empty. @@ -543,22 +572,6 @@ for (var = SPLAY_MIN(NAME, &head); var != NULL; var = nxt) { free(var); } .Ed -.Pp -Both -.Fn RB_INSERT -and -.Fn SPLAY_INSERT -return -.Va NULL -if the element was inserted in the tree successfully, otherwise they -return a pointer to the element with the colliding key. -.Pp -Accordingly, -.Fn RB_REMOVE -and -.Fn SPLAY_REMOVE -return the pointer to the removed element, otherwise they return -.Va NULL -to indicate an error. .Sh AUTHORS -The author of the tree macros is Niels Provos. +The author of the tree macros is +.An Niels Provos . diff --git a/compat/sys/tree.h b/compat/sys/tree.h index 08b1b2e..80d0f53 100644 --- a/compat/sys/tree.h +++ b/compat/sys/tree.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tree.h,v 1.11 2008/05/11 22:19:09 millert Exp $ */ +/* $OpenBSD: tree.h,v 1.13 2011/07/09 00:19:45 pirofti Exp $ */ /* * Copyright 2002 Niels Provos * All rights reserved. @@ -329,7 +329,7 @@ struct { \ } while (0) #ifndef RB_AUGMENT -#define RB_AUGMENT(x) +#define RB_AUGMENT(x) do {} while (0) #endif #define RB_ROTATE_LEFT(head, elm, tmp, field) do { \ @@ -730,9 +730,19 @@ name##_RB_MINMAX(struct name *head, int val) \ (x) != NULL; \ (x) = name##_RB_NEXT(x)) +#define RB_FOREACH_SAFE(x, name, head, y) \ + for ((x) = RB_MIN(name, head); \ + ((x) != NULL) && ((y) = name##_RB_NEXT(x), 1); \ + (x) = (y)) + #define RB_FOREACH_REVERSE(x, name, head) \ for ((x) = RB_MAX(name, head); \ (x) != NULL; \ (x) = name##_RB_PREV(x)) +#define RB_FOREACH_REVERSE_SAFE(x, name, head, y) \ + for ((x) = RB_MAX(name, head); \ + ((x) != NULL) && ((y) = name##_RB_PREV(x), 1); \ + (x) = (y)) + #endif /* _SYS_TREE_H_ */ diff --git a/configure.in b/configure.ac similarity index 99% rename from configure.in rename to configure.ac index 2350679..03fad83 100644 --- a/configure.in +++ b/configure.ac @@ -2,7 +2,7 @@ dnl ########### dnl ## SETUP ########################################################### dnl ########### -AC_INIT([ezstream], [0.5.6], +AC_INIT([ezstream], [0.6.0], [https://trac.xiph.org/newticket?component=ezstream]) AC_REVISION([$Id$]) AC_PREREQ([2.61]) diff --git a/doc/ezstream-file.sh.1.in.in b/doc/ezstream-file.sh.1.in.in index c2c1b11..77e72cc 100644 --- a/doc/ezstream-file.sh.1.in.in +++ b/doc/ezstream-file.sh.1.in.in @@ -1,6 +1,6 @@ .\" $Id$ .\" -.\" Copyright (c) 2009 Moritz Grimm +.\" Copyright (c) 2009, 2015 Moritz Grimm .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -23,7 +23,7 @@ .Sh SYNOPSIS .Nm .Bk -words -.Op Fl hnqVv +.Op Fl hmnqVv .Op Fl T Ar cfg_template .Op Ar .Ek @@ -62,6 +62,12 @@ binary. .It Fl h Print a summary of available command line parameters with short descriptions and exit. +.It Fl m +.Po +Passed to +.Nm ezstream . +.Pc +Disable all metadata updates and keep existing metadata in streams untouched. .It Fl n .Po Passed to @@ -108,4 +114,4 @@ as well as example playlist and metadata scripts. The .Nm script and this manual were written by -.An Moritz Grimm Aq mdgrimm@gmx.net . +.An Moritz Grimm . diff --git a/doc/ezstream.1.in.in b/doc/ezstream.1.in.in index 3e57418..c44ec78 100644 --- a/doc/ezstream.1.in.in +++ b/doc/ezstream.1.in.in @@ -1,6 +1,6 @@ .\" $Id$ .\" -.\" Copyright (c) 2007, 2009 Moritz Grimm +.\" Copyright (c) 2007, 2009, 2015 Moritz Grimm .\" .\" This program is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License version 2 as @@ -24,7 +24,7 @@ .Sh SYNOPSIS .Nm .Bk -words -.Op Fl hnqVv +.Op Fl hmnqVv .Fl c Ar configfile .Ek .Nm @@ -52,6 +52,8 @@ Use the XML configuration in .It Fl h Print a summary of available command line parameters with short descriptions and exit. +.It Fl m +Disable all metadata updates and keep existing metadata in streams untouched. .It Fl n Normalize metadata strings by removing excess whitespaces. .It Fl q @@ -275,6 +277,17 @@ See the .Sy METADATA section for details on how metadata is handled by .Nm . +.It Sy \& +.Pq Optional. +Configures the time +.Pq in seconds +inbetween additional metadata updates via +.Li \& . +A value of 0 +.Pq zero +triggers updates as fast as possible, while a value of \&-1 +.Pq minus one +or the absence of this configuration element disables this feature. .It Sy \& Set to .Sy 1 @@ -428,7 +441,7 @@ For example, to decode Ogg Vorbis files using the .Cm oggdec utility: .Pp -.Dl \&oggdec -R -o - \&"@T@\&"\& +.Dl \&oggdec -R -o - @T@\& .It Sy \& Set the command to encode raw data, received from standard input, to the specified stream format. @@ -447,7 +460,7 @@ the .Cm oggenc utility: .Pp -.Dl \&oggenc -r -q 1.5 -t \&"@M@\&" -\& +.Dl \&oggenc -r -q 1.5 -t @M@ -\& .El .Sh SCRIPTING The @@ -506,9 +519,17 @@ The main tool for handling metadata with .Nm is placeholders in decoder and encoder commands that are replaced with real content during runtime. -The tricky part is that one of the placeholders has to be handled differently, -depending on where the metadata comes from. -This section will explain each possible scenario. +.Pp +.Em Note: +To prevent malicious shell script in metadata +.Pq such as artist and title tags +from being executed, all metadata content is automatically enclosed in single +quotes, with escaped single quote and backslash characters inbetween. +To prevent this from causing unwanted side-effects +.Pq or introducting security risk , +placeholders +.Em must not +be quoted any further. .Ss Metadata Placeholders .Bl -tag -width -Ds .It Sy @T@ @@ -633,6 +654,8 @@ as well as example playlist and metadata scripts. was written by: .Pp .An Ed Zaleski Aq oddsock@oddsock.org -.An Moritz Grimm Aq mdgrimm@gmx.net +.An Moritz Grimm Aq mgrimm@mrsserver.net .Pp -This manual was written by Moritz Grimm. +.An -nosplit +This manual was written by +.An Moritz Grimm . diff --git a/examples/ezstream-file_template.xml b/examples/ezstream-file_template.xml index c9d11a7..ee794e1 100644 --- a/examples/ezstream-file_template.xml +++ b/examples/ezstream-file_template.xml @@ -18,6 +18,11 @@ configuration must be as follows: --> %FILENAME% + + 0 @s@: @a@ - @t@ + + 10 FLAC .flac - flac -s -d --force-raw-format --sign=signed --endian=little -o - "@T@" + flac -s -d --force-raw-format --sign=signed --endian=little -o - @T@ @@ -71,7 +71,7 @@ MP3 .mp3 - madplay -b 16 -R 44100 -S -o raw:- "@T@" + madplay -b 16 -R 44100 -S -o raw:- @T@ lame --preset cbr 128 -r -s 44.1 --bitwidth 16 - - @@ -80,8 +80,8 @@ --> VORBIS .ogg - oggdec -R -b 16 -e 0 -s 1 -o - "@T@" - oggenc -r -B 16 -C 2 -R 44100 --raw-endianness 0 -q 1.5 -t "@M@" - + oggdec -R -b 16 -e 0 -s 1 -o - @T@ + oggenc -r -B 16 -C 2 -R 44100 --raw-endianness 0 -q 1.5 -t @M@ - diff --git a/examples/ezstream_reencode_theora.xml b/examples/ezstream_reencode_theora.xml index d089316..eefaebb 100644 --- a/examples/ezstream_reencode_theora.xml +++ b/examples/ezstream_reencode_theora.xml @@ -67,12 +67,12 @@ --> THEORA .avi - ffmpeg2theora -x 192 -y 128 -a 0 -v 4 --title "@M@" -o - "@T@" + ffmpeg2theora -x 192 -y 128 -a 0 -v 4 --title @M@ -o - @T@ THEORA .mpg - ffmpeg2theora -x 192 -y 128 -a 0 -v 4 --title "@M@" -o - "@T@" + ffmpeg2theora -x 192 -y 128 -a 0 -v 4 --title @M@ -o - @T@ diff --git a/examples/ezstream_reencode_vorbis.xml b/examples/ezstream_reencode_vorbis.xml index 86e809f..0b0229c 100644 --- a/examples/ezstream_reencode_vorbis.xml +++ b/examples/ezstream_reencode_vorbis.xml @@ -62,7 +62,7 @@ FLAC .flac - flac -s -d --force-raw-format --sign=signed --endian=little -o - "@T@" + flac -s -d --force-raw-format --sign=signed --endian=little -o - @T@ @@ -72,7 +72,7 @@ MP3 .mp3 - madplay -b 16 -R 44100 -S -o raw:- "@T@" + madplay -b 16 -R 44100 -S -o raw:- @T@ lame --preset cbr 128 -r -s 44.1 --bitwidth 16 - - @@ -81,8 +81,8 @@ --> VORBIS .ogg - oggdec -R -b 16 -e 0 -s 1 -o - "@T@" - oggenc -r -B 16 -C 2 -R 44100 --raw-endianness 0 -q 1.5 -t "@M@" - + oggdec -R -b 16 -e 0 -s 1 -o - @T@ + oggenc -r -B 16 -C 2 -R 44100 --raw-endianness 0 -q 1.5 -t @M@ - diff --git a/mkcl.sh b/mkcl.sh deleted file mode 100755 index 6230951..0000000 --- a/mkcl.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -svn2cl --stdout -i --reparagraph --break-before-msg -o ChangeLog diff --git a/src/Makefile.am b/src/Makefile.am index 643a3a7..5114deb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -14,9 +14,8 @@ ezstream_SOURCES = \ xalloc.c ezstream_LDADD = @LIBOBJS@ @EZ_LIBS@ -INCLUDES = @COMPAT_INCLUDES@ AM_CFLAGS = @EZ_CFLAGS@ -AM_CPPFLAGS = @EZ_CPPFLAGS@ +AM_CPPFLAGS = @EZ_CPPFLAGS@ @COMPAT_INCLUDES@ AM_LDFLAGS = @EZ_LDFLAGS@ EXTRA_DIST = \ diff --git a/src/configfile.c b/src/configfile.c index 6072fc9..4679e22 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -2,7 +2,7 @@ /* * ezstream - source client for Icecast with external en-/decoder support * Copyright (C) 2003, 2004, 2005, 2006 Ed Zaleski - * Copyright (C) 2007, 2009 Moritz Grimm + * Copyright (C) 2007, 2009, 2015 Moritz Grimm * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -89,7 +89,8 @@ parseConfig(const char *fileName) xmlNodePtr cur; char *ls_xmlContentPtr; int program_set, reconnect_set, shuffle_set, - streamOnce_set, svrinfopublic_set; + streamOnce_set, svrinfopublic_set, + refresh_set; unsigned int config_error; xmlLineNumbersDefault(1); @@ -106,14 +107,17 @@ parseConfig(const char *fileName) return (0); } - memset(&ezConfig, '\000', sizeof(ezConfig)); + memset(&ezConfig, 0, sizeof(ezConfig)); + ezConfig.metadataRefreshInterval = -1; config_error = 0; program_set = 0; reconnect_set = 0; + refresh_set = 0; shuffle_set = 0; streamOnce_set = 0; svrinfopublic_set = 0; + for (cur = cur->xmlChildrenNode; cur != NULL; cur = cur->next) { if (!xmlStrcmp(cur->name, (const xmlChar *)"url")) { if (ezConfig.URL != NULL) { @@ -230,6 +234,27 @@ parseConfig(const char *fileName) } } } + if (!xmlStrcmp(cur->name, (const xmlChar *)"metadata_refreshinterval")) { + if (refresh_set) { + printf("%s[%ld]: Error: Cannot have multiple elements\n", + fileName, xmlGetLineNo(cur)); + config_error++; + continue; + } + if (cur->xmlChildrenNode != NULL) { + const char *errstr; + ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); + ezConfig.metadataRefreshInterval = (unsigned int)strtonum(ls_xmlContentPtr, -1LL, (long long)INT_MAX, &errstr); + if (errstr) { + printf("%s[%ld]: Error: In : '%s' is %s\n", + fileName, xmlGetLineNo(cur), ls_xmlContentPtr, errstr); + config_error++; + continue; + } + xmlFree(ls_xmlContentPtr); + refresh_set = 1; + } + } if (!xmlStrcmp(cur->name, (const xmlChar *)"playlist_program")) { if (program_set) { printf("%s[%ld]: Error: Cannot have multiple elements\n", diff --git a/src/configfile.h b/src/configfile.h index a2d5649..a52ccb0 100644 --- a/src/configfile.h +++ b/src/configfile.h @@ -2,7 +2,7 @@ /* * ezstream - source client for Icecast with external en-/decoder support * Copyright (C) 2003, 2004, 2005, 2006 Ed Zaleski - * Copyright (C) 2007 Moritz Grimm + * Copyright (C) 2007, 2015 Moritz Grimm * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -66,6 +66,7 @@ typedef struct tag_EZCONFIG { int fileNameIsProgram; int streamOnce; unsigned int reconnectAttempts; + int metadataRefreshInterval; } EZCONFIG; EZCONFIG * getEZConfig(void); diff --git a/src/ezstream-file.sh.in b/src/ezstream-file.sh.in index 1f9eb2e..637f354 100644 --- a/src/ezstream-file.sh.in +++ b/src/ezstream-file.sh.in @@ -4,7 +4,7 @@ # Convenience/wrapper script that uses ezstream to stream one or more files # given on the command line. -# Copyright (c) 2009 Moritz Grimm +# Copyright (c) 2009, 2015 Moritz Grimm # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -21,10 +21,10 @@ _myname="$(basename $0)" _filename_placeholder="%FILENAME%" -_opt_string="hnqT:Vv" +_opt_string="hmnqT:Vv" print_usage() { - echo "usage: ${_myname} [-hnqVv] [-T cfg_template] [file ...]" >&2 + echo "usage: ${_myname} [-hmnqVv] [-T cfg_template] [file ...]" >&2 } print_usage_help() @@ -32,6 +32,7 @@ print_usage_help() cat << __EOT >&2 -h print this help and exit + -m [ezstream] disable metadata updates -n [ezstream] normalize metadata strings -q [ezstream] suppress STDERR output from external en-/decoders -T template run ezstream using template for configuration @@ -45,6 +46,7 @@ See the ezstream-file.sh(1) manual for detailed information. __EOT } +_metadisable="" _normalize="" _quiet="" _verbose="" @@ -64,6 +66,8 @@ do print_usage_help exit 0 ;; + -m) + _metadisable="-m"; shift ;; -n) _normalize="-n"; shift ;; -q) @@ -140,6 +144,6 @@ else done fi -${EZSTREAM} ${_normalize} ${_quiet} ${_verbose} -c "${_cfg}" +${EZSTREAM} ${_metadisable} ${_normalize} ${_quiet} ${_verbose} -c "${_cfg}" exit $? diff --git a/src/ezstream.c b/src/ezstream.c index fa9387b..8811b9c 100644 --- a/src/ezstream.c +++ b/src/ezstream.c @@ -2,7 +2,7 @@ /* * ezstream - source client for Icecast with external en-/decoder support * Copyright (C) 2003, 2004, 2005, 2006 Ed Zaleski - * Copyright (C) 2007, 2009 Moritz Grimm + * Copyright (C) 2007, 2009, 2015 Moritz Grimm * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -50,6 +50,7 @@ char *__progname; #endif /* HAVE___PROGNAME */ int nFlag; +int mFlag; int qFlag; int sFlag; int vFlag; @@ -89,8 +90,8 @@ typedef struct tag_ID3Tag { } ID3Tag; int urlParse(const char *, char **, unsigned short *, char **); -void replaceString(const char *, char *, size_t, const char *, - const char *); +char * shellQuote(const char *); +char * replaceString(const char *, const char *, const char *); char * buildCommandString(const char *, const char *, metadata_t *); char * getMetadataString(const char *, metadata_t *); metadata_t * getMetadata(const char *); @@ -196,25 +197,67 @@ urlParse(const char *url, char **hostname, unsigned short *port, return (1); } -void -replaceString(const char *source, char *dest, size_t size, - const char *from, const char *to) -{ - const char *p1 = source; - const char *p2; +#define SHELLQUOTE_INLEN_MAX 8191UL +char * +shellQuote(const char *in) +{ + char *out, *out_p; + size_t out_len; + const char *in_p; + + out_len = (strlen(in) > SHELLQUOTE_INLEN_MAX) + ? SHELLQUOTE_INLEN_MAX + : strlen(in); + out_len = out_len * 2 + 2; + out = xcalloc(out_len + 1, sizeof(char)); + + out_p = out; + in_p = in; + + *out_p++ = '\''; + out_len--; + while (*in_p && out_len > 2) { + switch (*in_p) { + case '\'': + case '\\': + *out_p++ = '\\'; + out_len--; + break; + default: + break; + } + *out_p++ = *in_p++; + out_len--; + } + *out_p++ = '\''; + + return (out); +} + +char * +replaceString(const char *source, const char *from, const char *to) +{ + char *to_quoted, *dest; + size_t dest_size; + const char *p1, *p2; + + to_quoted = shellQuote(to); + dest_size = strlen(source) + strlen(to_quoted) + 1; + dest = xcalloc(dest_size, sizeof(char)); + + p1 = source; p2 = strstr(p1, from); if (p2 != NULL) { - if ((unsigned int)(p2 - p1) >= size) { - printf("%s: replaceString(): Internal error: p2 - p1 >= size\n", - __progname); - abort(); - } strncat(dest, p1, (size_t)(p2 - p1)); - strlcat(dest, to, size); + strlcat(dest, to_quoted, dest_size); p1 = p2 + strlen(from); } - strlcat(dest, p1, size); + strlcat(dest, p1, dest_size); + + xfree(to_quoted); + + return (dest); } char * @@ -226,9 +269,7 @@ buildCommandString(const char *extension, const char *fileName, char *encoder = NULL; char *decoder = NULL; char *newDecoder = NULL; - size_t newDecoderLen = 0; char *newEncoder = NULL; - size_t newEncoderLen = 0; char *localTitle = UTF8toCHAR(metadata_get_title(mdata), ICONV_REPLACE); char *localArtist = UTF8toCHAR(metadata_get_artist(mdata), @@ -246,23 +287,16 @@ buildCommandString(const char *extension, const char *fileName, xfree(decoder); return (NULL); } - newDecoderLen = strlen(decoder) + strlen(fileName) + 1; - newDecoder = xcalloc(newDecoderLen, sizeof(char)); - replaceString(decoder, newDecoder, newDecoderLen, TRACK_PLACEHOLDER, - fileName); + newDecoder = replaceString(decoder, TRACK_PLACEHOLDER, fileName); if (strstr(decoder, ARTIST_PLACEHOLDER) != NULL) { - size_t tmpLen = strlen(newDecoder) + strlen(localArtist) + 1; - char *tmpStr = xcalloc(tmpLen, sizeof(char)); - replaceString(newDecoder, tmpStr, tmpLen, ARTIST_PLACEHOLDER, - localArtist); + char *tmpStr = replaceString(newDecoder, ARTIST_PLACEHOLDER, + localArtist); xfree(newDecoder); newDecoder = tmpStr; } if (strstr(decoder, TITLE_PLACEHOLDER) != NULL) { - size_t tmpLen = strlen(newDecoder) + strlen(localTitle) + 1; - char *tmpStr = xcalloc(tmpLen, sizeof(char)); - replaceString(newDecoder, tmpStr, tmpLen, TITLE_PLACEHOLDER, - localTitle); + char *tmpStr = replaceString(newDecoder, TITLE_PLACEHOLDER, + localTitle); xfree(newDecoder); newDecoder = tmpStr; } @@ -279,27 +313,20 @@ buildCommandString(const char *extension, const char *fileName, if (strstr(decoder, METADATA_PLACEHOLDER) != NULL) { if (metadataFromProgram && pezConfig->metadataFormat != NULL) { char *mdataString = getMetadataString(pezConfig->metadataFormat, mdata); - size_t tmpLen = strlen(newDecoder) + strlen(mdataString) + 1; - char *tmpStr = xcalloc(tmpLen, sizeof(char)); - replaceString(newDecoder, tmpStr, tmpLen, - METADATA_PLACEHOLDER, mdataString); + char *tmpStr = replaceString(newDecoder, + METADATA_PLACEHOLDER, mdataString); xfree(newDecoder); xfree(mdataString); newDecoder = tmpStr; } else { if (!metadataFromProgram && strstr(decoder, TITLE_PLACEHOLDER) != NULL) { - size_t tmpLen = strlen(newDecoder) + 1; - char *tmpStr = xcalloc(tmpLen, sizeof(char)); - replaceString(newDecoder, tmpStr, tmpLen, - METADATA_PLACEHOLDER, ""); + char *tmpStr = replaceString(newDecoder, + METADATA_PLACEHOLDER, ""); xfree(newDecoder); newDecoder = tmpStr; } else { - size_t tmpLen = strlen(newDecoder) + strlen(localMetaString) + 1; - char *tmpStr = xcalloc(tmpLen, sizeof(char)); - replaceString(newDecoder, tmpStr, tmpLen, - METADATA_PLACEHOLDER, - localMetaString); + char *tmpStr = replaceString(newDecoder, + METADATA_PLACEHOLDER, localMetaString); xfree(newDecoder); newDecoder = tmpStr; } @@ -325,42 +352,30 @@ buildCommandString(const char *extension, const char *fileName, return (commandString); } - newEncoderLen = strlen(encoder) + strlen(localArtist) + 1; - newEncoder = xcalloc(newEncoderLen, sizeof(char)); - replaceString(encoder, newEncoder, newEncoderLen, ARTIST_PLACEHOLDER, - localArtist); + newEncoder = replaceString(encoder, ARTIST_PLACEHOLDER, localArtist); if (strstr(encoder, TITLE_PLACEHOLDER) != NULL) { - size_t tmpLen = strlen(newEncoder) + strlen(localTitle) + 1; - char *tmpStr = xcalloc(tmpLen, sizeof(char)); - replaceString(newEncoder, tmpStr, tmpLen, TITLE_PLACEHOLDER, - localTitle); + char *tmpStr = replaceString(newEncoder, TITLE_PLACEHOLDER, + localTitle); xfree(newEncoder); newEncoder = tmpStr; } if (strstr(encoder, METADATA_PLACEHOLDER) != NULL) { if (metadataFromProgram && pezConfig->metadataFormat != NULL) { char *mdataString = getMetadataString(pezConfig->metadataFormat, mdata); - size_t tmpLen = strlen(newEncoder) + strlen(mdataString) + 1; - char *tmpStr = xcalloc(tmpLen, sizeof(char)); - replaceString(newEncoder, tmpStr, tmpLen, - METADATA_PLACEHOLDER, mdataString); + char *tmpStr = replaceString(newEncoder, + METADATA_PLACEHOLDER, mdataString); xfree(newEncoder); xfree(mdataString); newEncoder = tmpStr; } else { if (!metadataFromProgram && strstr(encoder, TITLE_PLACEHOLDER) != NULL) { - size_t tmpLen = strlen(newEncoder) + 1; - char *tmpStr = xcalloc(tmpLen, sizeof(char)); - replaceString(newEncoder, tmpStr, tmpLen, - METADATA_PLACEHOLDER, ""); + char *tmpStr = replaceString(newEncoder, + METADATA_PLACEHOLDER, ""); xfree(newEncoder); newEncoder = tmpStr; } else { - size_t tmpLen = strlen(newEncoder) + strlen(localMetaString) + 1; - char *tmpStr = xcalloc(tmpLen, sizeof(char)); - replaceString(newEncoder, tmpStr, tmpLen, - METADATA_PLACEHOLDER, - localMetaString); + char *tmpStr = replaceString(newEncoder, + METADATA_PLACEHOLDER, localMetaString); xfree(newEncoder); newEncoder = tmpStr; } @@ -388,7 +403,6 @@ char * getMetadataString(const char *format, metadata_t *mdata) { char *tmp, *str; - size_t len; if (mdata == NULL) { printf("%s: getMetadataString(): Internal error: NULL metadata_t\n", @@ -402,34 +416,26 @@ getMetadataString(const char *format, metadata_t *mdata) str = xstrdup(format); if (strstr(format, ARTIST_PLACEHOLDER) != NULL) { - len = strlen(str) + strlen(metadata_get_artist(mdata)) + 1; - tmp = xcalloc(len, sizeof(char)); - replaceString(str, tmp, len, ARTIST_PLACEHOLDER, - metadata_get_artist(mdata)); + tmp = replaceString(str, ARTIST_PLACEHOLDER, + metadata_get_artist(mdata)); xfree(str); str = tmp; } if (strstr(format, TITLE_PLACEHOLDER) != NULL) { - len = strlen(str) + strlen(metadata_get_title(mdata)) + 1; - tmp = xcalloc(len, sizeof(char)); - replaceString(str, tmp, len, TITLE_PLACEHOLDER, - metadata_get_title(mdata)); + tmp = replaceString(str, TITLE_PLACEHOLDER, + metadata_get_title(mdata)); xfree(str); str = tmp; } if (strstr(format, STRING_PLACEHOLDER) != NULL) { - len = strlen(str) + strlen(metadata_get_string(mdata)) + 1; - tmp = xcalloc(len, sizeof(char)); - replaceString(str, tmp, len, STRING_PLACEHOLDER, - metadata_get_string(mdata)); + tmp = replaceString(str, STRING_PLACEHOLDER, + metadata_get_string(mdata)); xfree(str); str = tmp; } if (strstr(format, TRACK_PLACEHOLDER) != NULL) { - len = strlen(str) + strlen(metadata_get_filename(mdata)) + 1; - tmp = xcalloc(len, sizeof(char)); - replaceString(str, tmp, len, TRACK_PLACEHOLDER, - metadata_get_filename(mdata)); + tmp = replaceString(str, TRACK_PLACEHOLDER, + metadata_get_filename(mdata)); xfree(str); str = tmp; } @@ -477,6 +483,9 @@ setMetadata(shout_t *shout, metadata_t *mdata, char **mdata_copy) abort(); } + if (mFlag) + return (SHOUTERR_SUCCESS); + if (mdata == NULL) return 1; @@ -750,6 +759,7 @@ sendStream(shout_t *shout, FILE *filepstream, const char *fileName, int ret; double kbps = -1.0; struct timeval timeStamp, *startTime = tv; + struct timeval callTime, currentTime; if (startTime == NULL) { printf("%s: sendStream(): Internal error: startTime is NULL\n", @@ -757,6 +767,8 @@ sendStream(shout_t *shout, FILE *filepstream, const char *fileName, abort(); } + ez_gettimeofday((void *)&callTime); + timeStamp.tv_sec = startTime->tv_sec; timeStamp.tv_usec = startTime->tv_usec; @@ -795,7 +807,15 @@ sendStream(shout_t *shout, FILE *filepstream, const char *fileName, ret = STREAM_SKIP; break; } - if (queryMetadata) { + + ez_gettimeofday((void *)¤tTime); + + if (queryMetadata || + (pezConfig->metadataRefreshInterval != -1 + && (currentTime.tv_sec - callTime.tv_sec + >= pezConfig->metadataRefreshInterval) + ) + ) { queryMetadata = 0; if (metadataFromProgram) { ret = STREAM_UPDMDATA; @@ -805,8 +825,7 @@ sendStream(shout_t *shout, FILE *filepstream, const char *fileName, total += bytes_read; if (qFlag && vFlag) { - struct timeval tval; - double oldTime, newTime; + double oldTime, newTime; if (!isStdin && playlistMode) { if (pezConfig->fileNameIsProgram) { @@ -822,20 +841,22 @@ sendStream(shout_t *shout, FILE *filepstream, const char *fileName, oldTime = (double)timeStamp.tv_sec + (double)timeStamp.tv_usec / 1000000.0; - ez_gettimeofday((void *)&tval); - newTime = (double)tval.tv_sec - + (double)tval.tv_usec / 1000000.0; + newTime = (double)currentTime.tv_sec + + (double)currentTime.tv_usec / 1000000.0; if (songLenStr == NULL) printf(" [ %s]", - getTimeString(tval.tv_sec - startTime->tv_sec)); + getTimeString(currentTime.tv_sec - + startTime->tv_sec)); else printf(" [ %s/%s]", - getTimeString(tval.tv_sec - startTime->tv_sec), + getTimeString(currentTime.tv_sec - + startTime->tv_sec), songLenStr); if (newTime - oldTime >= 1.0) { - kbps = (((double)(total - oldTotal) / (newTime - oldTime)) * 8.0) / 1000.0; - timeStamp.tv_sec = tval.tv_sec; - timeStamp.tv_usec = tval.tv_usec; + kbps = (((double)(total - oldTotal) + / (newTime - oldTime)) * 8.0) / 1000.0; + timeStamp.tv_sec = currentTime.tv_sec; + timeStamp.tv_usec = currentTime.tv_usec; oldTotal = total; } if (kbps < 0) @@ -936,6 +957,8 @@ streamFile(shout_t *shout, const char *fileName) } if (ret == STREAM_UPDMDATA || queryMetadata) { queryMetadata = 0; + if (mFlag) + continue; if (metadataFromProgram) { char *mdataStr = NULL; metadata_t *prog_mdata; @@ -954,8 +977,9 @@ streamFile(shout_t *shout, const char *fileName) continue; } metadata_free(&prog_mdata); - printf("%s: New metadata: ``%s''\n", - __progname, mdataStr); + if (vFlag > 1) + printf("%s: New metadata: ``%s''\n", + __progname, mdataStr); xfree(mdataStr); } } @@ -969,7 +993,7 @@ streamFile(shout_t *shout, const char *fileName) if (popenFlag) pclose(filepstream); - else + else if (!isStdin) fclose(filepstream); if (songLenStr != NULL) @@ -1073,7 +1097,7 @@ ez_shutdown(int exitval) void usage(void) { - printf("usage: %s [-hnqVv] -c configfile\n", __progname); + printf("usage: %s [-hmnqVv] -c configfile\n", __progname); printf(" %s -s [playlist]\n", __progname); } @@ -1083,6 +1107,7 @@ usageHelp(void) printf("\n"); printf(" -c configfile use XML configuration in configfile (mandatory)\n"); printf(" -h display this additional help and exit\n"); + printf(" -m disable metadata updates\n"); printf(" -n normalize metadata strings\n"); printf(" -q suppress STDERR output from external en-/decoders\n"); printf(" -s [playlist] read lines from playlist (or STDIN), shuffle and print them to\n"); @@ -1120,11 +1145,12 @@ main(int argc, char *argv[]) __progname = getProgname(argv[0]); pezConfig = getEZConfig(); + mFlag = 0; nFlag = 0; qFlag = 0; vFlag = 0; - while ((c = local_getopt(argc, argv, "c:hnqsVv")) != -1) { + while ((c = local_getopt(argc, argv, "c:hmnqsVv")) != -1) { switch (c) { case 'c': if (configFile != NULL) { @@ -1138,6 +1164,9 @@ main(int argc, char *argv[]) usage(); usageHelp(); return (ez_shutdown(0)); + case 'm': + mFlag = 1; + break; case 'n': nFlag = 1; break; @@ -1316,7 +1345,6 @@ main(int argc, char *argv[]) printf("%s: Using program '%s' to get filenames for streaming\n", __progname, pezConfig->fileName); - ret = 1; do { if (playlistMode) { ret = streamPlaylist(shout, diff --git a/src/ezstream.h b/src/ezstream.h index 63086c3..6e8d3ca 100644 --- a/src/ezstream.h +++ b/src/ezstream.h @@ -1,6 +1,6 @@ /* $Id$ */ /* - * Copyright (c) 2007, 2009 Moritz Grimm + * Copyright (c) 2007, 2009 Moritz Grimm * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -27,9 +27,8 @@ #endif /* HAVE_SYS_TYPES_H */ #ifdef HAVE_SYS_TIME_H # include -#else /* HAVE_SYS_TIME_H */ -# include #endif /* HAVE_SYS_TIME_H */ +#include #ifdef HAVE_SYS_STAT_H # include #endif /* HAVE_SYS_STAT_H */ diff --git a/src/metadata.c b/src/metadata.c index 8e2aa04..14cbf4c 100644 --- a/src/metadata.c +++ b/src/metadata.c @@ -1,6 +1,6 @@ /* $Id$ */ /* - * Copyright (c) 2007, 2009 Moritz Grimm + * Copyright (c) 2007, 2009 Moritz Grimm * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/metadata.h b/src/metadata.h index 852b91a..75d07e6 100644 --- a/src/metadata.h +++ b/src/metadata.h @@ -1,6 +1,6 @@ /* $Id$ */ /* - * Copyright (c) 2007 Moritz Grimm + * Copyright (c) 2007 Moritz Grimm * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/playlist.c b/src/playlist.c index a0e1c62..4a151bc 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -1,6 +1,6 @@ /* $Id$ */ /* - * Copyright (c) 2007, 2009 Moritz Grimm + * Copyright (c) 2007, 2009 Moritz Grimm * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/playlist.h b/src/playlist.h index 01640cb..674a5a9 100644 --- a/src/playlist.h +++ b/src/playlist.h @@ -1,6 +1,6 @@ /* $Id$ */ /* - * Copyright (c) 2007 Moritz Grimm + * Copyright (c) 2007 Moritz Grimm * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/util.c b/src/util.c index da3b8b2..9ecd430 100644 --- a/src/util.c +++ b/src/util.c @@ -2,7 +2,7 @@ /* * ezstream - source client for Icecast with external en-/decoder support * Copyright (C) 2003, 2004, 2005, 2006 Ed Zaleski - * Copyright (C) 2007, 2009 Moritz Grimm + * Copyright (C) 2007, 2009 Moritz Grimm * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/util.h b/src/util.h index 1e69c0c..0db8102 100644 --- a/src/util.h +++ b/src/util.h @@ -2,7 +2,7 @@ /* * ezstream - source client for Icecast with external en-/decoder support * Copyright (C) 2003, 2004, 2005, 2006 Ed Zaleski - * Copyright (C) 2007 Moritz Grimm + * Copyright (C) 2007 Moritz Grimm * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/xalloc.c b/src/xalloc.c index 7723200..6d30959 100644 --- a/src/xalloc.c +++ b/src/xalloc.c @@ -1,6 +1,6 @@ /* $Id$ */ /* - * Copyright (C) 2007 Moritz Grimm + * Copyright (C) 2007 Moritz Grimm * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/xalloc.h b/src/xalloc.h index 3a96c83..160c3a8 100644 --- a/src/xalloc.h +++ b/src/xalloc.h @@ -7,7 +7,7 @@ * and ensures that out-of-memory issues always cause the * application to exit. * - * Copyright (C) 2007 Moritz Grimm + * Copyright (C) 2007 Moritz Grimm * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/win32/README.win32 b/win32/README.win32 index ef268a2..33783b6 100644 --- a/win32/README.win32 +++ b/win32/README.win32 @@ -67,13 +67,13 @@ A few useful features are missing in the Windows version of ezstream: Ezstream uses: * zlib (http://www.zlib.net/, BSD-like license) - * libiconv (http://www.gnu.org/software/libiconv/, LGPL) + * libiconv (https://www.gnu.org/software/libiconv/, LGPL) * libxml2 (http://xmlsoft.org/, BSD-like license) * libogg, libvorbis, libvorbisfile (http://www.vorbis.com/, BSD-like license) - * libFLAC (http://flac.sourceforge.net/, BSD-like license) + * libFLAC (https://xiph.org/flac/, BSD-like license) * libtheora (http://www.theora.org/, BSD-like license) * libshout (http://www.icecast.org, LGPL) - * TagLib (http://ktown.kde.org/~wheeler/taglib.html, LGPL) + * TagLib (https://taglib.github.io/, LGPL) These libraries are statically linked into the ezstream.exe file. diff --git a/win32/config.h b/win32/config.h index d69d5b3..781abc0 100644 --- a/win32/config.h +++ b/win32/config.h @@ -1,7 +1,7 @@ #ifndef __WIN32_CONFIG_H__ #define __WIN32_CONFIG_H__ -#define PACKAGE_STRING "ezstream 0.5.6" +#define PACKAGE_STRING "ezstream 0.6.0" #define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_STAT_H 1