* 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.
git-svn-id: https://svn.xiph.org/trunk/ezstream@12554 0101bb08-14d6-0310-b084-bc0e0c8e3800
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.
git-svn-id: https://svn.xiph.org/trunk/ezstream@12553 0101bb08-14d6-0310-b084-bc0e0c8e3800
* 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.
git-svn-id: https://svn.xiph.org/trunk/ezstream@12552 0101bb08-14d6-0310-b084-bc0e0c8e3800
* 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.
git-svn-id: https://svn.xiph.org/trunk/ezstream@12550 0101bb08-14d6-0310-b084-bc0e0c8e3800
fixed a buffer overflow on large id3tags
use pclose for popen'd file handles
git-svn-id: https://svn.xiph.org/trunk/ezstream@10589 0101bb08-14d6-0310-b084-bc0e0c8e3800