1
0
mirror of https://gitlab.xiph.org/xiph/ezstream.git synced 2025-02-02 15:07:45 -05:00

Working TagLib support (optional.)

git-svn-id: https://svn.xiph.org/trunk/ezstream@12684 0101bb08-14d6-0310-b084-bc0e0c8e3800
This commit is contained in:
moritz 2007-03-08 20:24:09 +00:00
parent 46cdb29f16
commit 3cd7528b07
5 changed files with 120 additions and 12 deletions

4
NEWS
View File

@ -8,6 +8,10 @@ Changes in 0.4.0, (SVN trunk):
- [ADD] Implement a basename() function for Windows that behaves like the
ones used on Windows.
* various:
- [ADD] Allow ezstream to use TagLib for reading metadata from media
files. TagLib (libtag_c) is now an optional dependency.
Changes in 0.3.0, released on 2007-03-05:

11
README
View File

@ -18,7 +18,8 @@ format to another, and stream the result to an Icecast server. With reencoding
enabled, ezstream is a very flexible source client.
Supported media formats for streaming are MP3, Ogg Vorbis and Ogg Theora.
Metadata support is available for MP3 (ID3v1 only) and Ogg Vorbis.
Ezstream natively supports metadata in MP3 (ID3v1 only) and Ogg Vorbis, or many
more formats when it is built with the TagLib option.
Ezstream is free software and licensed under the GNU General Public License.
See the COPYING file for details.
@ -35,6 +36,10 @@ Ezstream depends on:
(http://www.vorbis.com/ and http://www.theora.org/)
* libxml 2.x (http://xmlsoft.org/)
Ezstream optionally uses:
* TagLib 1.x (1.4 or newer recommended, will be used via the libtag_c wrapper)
(http://developer.kde.org/~wheeler/taglib.html)
INSTALLATION
@ -47,9 +52,11 @@ configure script, a couple of additional options are available:
--enable-examplesdir=DIR example configuration files installation directory
(default: DATADIR/examples/ezstream)
--with-xml-config=PATH use xml-config in PATH to find libxml
--with-taglib=PREFIX Prefix where TagLib is installed (default:
autodetect)
--with-ogg=PREFIX Prefix where libogg is installed (optional)
--with-vorbis=PREFIX Prefix where libvorbis is installed (optional)
--with-xml-config=PATH use xml-config in PATH to find libxml
The compilation and installation process boils down to the usual

View File

@ -43,7 +43,7 @@ fi
dnl MISC SYSTEM CHARACTERISTICS
dnl __progname check adapted from OpenNTPd-portable's configure.ac
dnl __progname check adapted from OpenNTPd-portable configure.ac
AC_MSG_CHECKING([whether libc defines __progname])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <stdio.h>]],
@ -81,6 +81,99 @@ fi
dnl CONFIGURE OPTIONS
dnl Optional: TagLib support
AC_ARG_VAR([TAGLIB_PREFIX], [path to TagLib installation])
if test -n "${TAGLIB_PREFIX}"; then
taglib_prefix="${TAGLIB_PREFIX}"
else
taglib_prefix=""
fi
use_taglib=yes
require_taglib=no
AC_ARG_WITH(taglib,
[AS_HELP_STRING([--with-taglib=PREFIX],
[Prefix where TagLib is installed (default: autodetect)])],
[case "$withval" in
yes) require_taglib=yes
if test -z "$taglib_prefix"; then
taglib_prefix=/usr/local
fi
;;
no) use_taglib=no ;;
*) require_taglib=yes
taglib_prefix="$withval"
;;
esac], [])
have_taglib=no
AC_MSG_CHECKING([for TagLib option])
if test x"$use_taglib" != "xno"; then
if test x"$require_taglib" = "xyes"; then
AC_MSG_RESULT([enabled])
else
AC_MSG_RESULT([autodetect])
fi
TAGLIB_CFLAGS=""
TAGLIB_CPPFLAGS=""
TAGLIB_LIBS="-ltag_c"
if test -n "$taglib_prefix"; then
TAGLIB_CPPFLAGS="-I${taglib_prefix}/include"
TAGLIB_LIBS="-L${taglib_prefix}/lib ${TAGLIB_LIBS}"
fi
ac_taglib_save_CFLAGS="$CFLAGS"
ac_taglib_save_CPPFLAGS="$CPPFLAGS"
ac_taglib_save_LIBS="$LIBS"
CFLAGS="${TAGLIB_CFLAGS}"
CPPFLAGS="${TAGLIB_CPPFLAGS}"
LIBS="${TAGLIB_LIBS}"
AC_CHECK_HEADERS([taglib/tag_c.h], [
AC_MSG_CHECKING([whether TagLib works])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <taglib/tag_c.h>]],
[[ taglib_set_string_management_enabled(0); ]])],
[
AC_MSG_RESULT([yes])
have_taglib=yes
], [
if test x"$require_taglib" = "xyes"; then
AC_MSG_RESULT([no])
AC_MSG_ERROR([Cannot link against libtag_c in ${taglib_prefix}/lib])
else
AC_MSG_RESULT([no])
AC_MSG_WARN([Error while linking against libtag_c in ${taglib_prefix}/lib, disabling support])
fi
]
)
], [
if test x"$require_taglib" = "xyes"; then
AC_MSG_ERROR([Cannot find taglib/tag_c.h in ${taglib_prefix}/include])
else
AC_MSG_NOTICE([No TagLib C header found on this system])
fi
])
CFLAGS="$ac_taglib_save_CFLAGS"
CPPFLAGS="$ac_taglib_save_CPPFLAGS"
LIBS="$ac_taglib_save_LIBS"
else
AC_MSG_RESULT([disabled])
fi
if test x"$have_taglib" = "xyes"; then
AC_DEFINE(HAVE_TAGLIB, 1, [Define whether we're using TagLib])
else
TAGLIB_CFLAGS=""
TAGLIB_CPPFLAGS=""
TAGLIB_LIBS=""
fi
AC_SUBST(TAGLIB_CFLAGS)
AC_SUBST(TAGLIB_CPPFLAGS)
AC_SUBST(TAGLIB_LIBS)
dnl Check for Ogg Vorbis
XIPH_PATH_OGG(, AC_MSG_ERROR([Must have libogg 1.x installed.]))
XIPH_PATH_VORBIS(, AC_MSG_ERROR([Must have libvorbis 1.x installed.]))

View File

@ -4,10 +4,10 @@ bin_PROGRAMS = ezstream
ezstream_SOURCES = compat.c configfile.c ezstream.c metadata.c playlist.c \
util.c
ezstream_LDADD = @LIBOBJS@ @XIPH_LIBS@
ezstream_LDADD = @LIBOBJS@ @XIPH_LIBS@ @TAGLIB_LIBS@
AM_CFLAGS = @XIPH_CFLAGS@
AM_CPPFLAGS = @XIPH_CPPFLAGS@
AM_CFLAGS = @XIPH_CFLAGS@ @TAGLIB_CFLAGS@
AM_CPPFLAGS = @XIPH_CPPFLAGS@ @TAGLIB_CPPFLAGS@
EXTRA_DIST = compat.h configfile.h getopt.h metadata.h playlist.h \
strfctns.h util.h

View File

@ -33,6 +33,9 @@
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_TAGLIB
# include <taglib/tag_c.h>
#endif
#include <vorbis/vorbisfile.h>
#include "compat.h"
@ -81,7 +84,7 @@ metadata_create(const char *filename)
void
metadata_use_taglib(metadata_t *md, FILE **filep)
#ifdef HAVE_TAG_C
#ifdef HAVE_TAGLIB
{
TagLib_File *tf;
TagLib_Tag *tt;
@ -98,6 +101,7 @@ metadata_use_taglib(metadata_t *md, FILE **filep)
metadata_clean_md(md);
taglib_set_string_management_enabled(0);
taglib_set_strings_unicode(0);
if (md->string != NULL)
xfree(md->string);
@ -130,11 +134,11 @@ metadata_use_taglib(metadata_t *md, FILE **filep)
__progname);
abort();
}
#endif /* HAVE_TAG_C */
#endif /* HAVE_TAGLIB */
void
metadata_use_self(metadata_t *md, FILE **filep)
#ifdef HAVE_TAG_C
#ifdef HAVE_TAGLIB
{
printf("%s: Internal error: metadata_use_self() called with TagLib support\n",
__progname);
@ -223,7 +227,7 @@ metadata_use_self(metadata_t *md, FILE **filep)
if (md->artist == NULL && md->title == NULL)
md->string = metadata_get_name(md->filename);
}
#endif /* HAVE_TAG_C */
#endif /* HAVE_TAGLIB */
void
metadata_clean_md(metadata_t *md)
@ -400,11 +404,11 @@ metadata_file_update(metadata_t *md)
return (0);
}
#ifdef HAVE_TAG_C
#ifdef HAVE_TAGLIB
metadata_use_taglib(md, &filep);
#else
metadata_use_self(md, &filep);
#endif /* HAVE_TAG_C */
#endif /* HAVE_TAGLIB */
metadata_process_md(md);