Commit 01a472bb authored by Stan Seibert's avatar Stan Seibert

- Speex support for ogg123. Reads comments and all that, but does not

  calculate the total play length of the file.  Chained streams don't
  work yet either.  Just like FLAC, this support is optional and can
  be disabled at build time using --without-speex.

- Fixed some very silly printing bugs that prevented metadata from being
printed at the right verbosity level.

svn path=/trunk/vorbis-tools/; revision=4227
parent 784bfe67
......@@ -91,6 +91,7 @@ AC_ARG_ENABLE(ogginfo,[ --disable-ogginfo Skip building ogginfo], build_ogginf
AC_ARG_ENABLE(vcut, [ --disable-vcut Skip building vcut], build_vcut="$enableval", build_vcut="yes")
AC_ARG_ENABLE(vorbiscomment, [ --disable-vorbiscomment Skip building vorbiscomment], build_vorbiscomment="$enableval", build_vorbiscomment="yes")
AC_ARG_WITH(flac, [ --without-flac Do not compile FLAC support], build_flac="$enableval", build_flac="yes")
AC_ARG_WITH(speex, [ --without-speex Do not compile Speex support], build_speex="$enableval", build_speex="yes")
dnl --------------------------------------------------
dnl Check for generally needed libraries
......@@ -125,6 +126,8 @@ if test "x$build_ogg123" = xyes; then
fi
fi
dnl -------------------- FLAC ----------------------
FLAC_LIBS=
AC_CHECK_LIB(m,log,FLAC_EXTRA_LIBS="-lm")
......@@ -147,6 +150,31 @@ fi
AM_CONDITIONAL(HAVE_LIBFLAC, test "x$build_flac" = xyes)
AC_SUBST(FLAC_LIBS)
dnl ------------------- Speex ------------------------
SPEEX_LIBS=
AC_CHECK_LIB(m,log,SPEEX_EXTRA_LIBS="-lm")
AC_CHECK_LIB(speex, speex_decoder_init,have_libspeex=yes,
AC_MSG_WARN(libspeex missing)
have_libspeex=no, $SPEEX_EXTRA_LIBS
)
AC_CHECK_HEADER(speex.h,,
AC_MSG_WARN(libspeex headers missing)
have_libspeex=no,[ ])
if test "x$have_libspeex" = xyes; then
if test "x$build_speex" = xyes; then
AC_DEFINE(HAVE_LIBSPEEX)
SPEEX_LIBS="$SPEEX_EXTRA_LIBS -lspeex"
fi
else
build_speex="no"
fi
AM_CONDITIONAL(HAVE_LIBSPEEX, test "x$build_speex" = xyes)
AC_SUBST(SPEEX_LIBS)
dnl --------------------------------------------------
dnl Check for library functions
dnl --------------------------------------------------
......
......@@ -14,18 +14,23 @@ ogg123sources = audio.c buffer.c callbacks.c \
format.h ogg123.h playlist.h status.h \
transport.h vorbis_comments.h
flacsources = flac_format.c easyflac.c easyflac.h
speexsources = speex_format.c
if HAVE_LIBFLAC
buildsources = $(ogg123sources) $(flacsources)
flaccompile = $(flacsources)
flaclibs = @FLAC_LIBS@
else
buildsources = $(ogg123sources)
flaccompile =
flaclibs =
endif
if HAVE_LIBSPEEX
speexcompile = $(speexsources)
speexlibs = @SPEEX_LIBS@
else
speexcompile =
speexlibs =
endif
......@@ -45,16 +50,17 @@ INCLUDES = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @AO_CFLAGS@ @CURL_CFLAGS@ \
ogg123_LDADD = @SHARE_LIBS@ \
@VORBISFILE_LIBS@ @VORBIS_LIBS@ @OGG_LIBS@ @AO_LIBS@ \
@SOCKET_LIBS@ @LIBICONV@ @CURL_LIBS@ @PTHREAD_CFLAGS@ \
@PTHREAD_LIBS@ @I18N_LIBS@ $(flaclibs)
@PTHREAD_LIBS@ @I18N_LIBS@ $(flaclibs) $(speexlibs)
ogg123_DEPENDENCIES = @SHARE_LIBS@
ogg123_SOURCES = $(buildsources)
ogg123_SOURCES = $(ogg123sources) $(speexcompile) $(flaccompile)
man_MANS = $(mans)
doc_DATA = $(docs)
endif
EXTRA_DIST = $(ogg123sources) $(flacsources) $(mans) $(docs)
EXTRA_DIST = $(ogg123sources) $(flacsources) $(speexsources) $(mans) $(docs)
debug:
......
......@@ -11,7 +11,7 @@
* *
********************************************************************
last mod: $Id: callbacks.c,v 1.7 2002/07/06 04:27:19 msmith Exp $
last mod: $Id: callbacks.c,v 1.8 2003/01/12 20:19:22 volsung Exp $
********************************************************************/
......@@ -351,5 +351,6 @@ void decoder_buffered_metadata_callback (void *arg, int verbosity,
}
}
sm_arg->verbosity = verbosity;
buffer_append_action_at_end(buf, &status_message_action, sm_arg);
}
......@@ -11,7 +11,7 @@
* *
********************************************************************
last mod: $Id: flac_format.c,v 1.1 2003/01/11 22:51:44 volsung Exp $
last mod: $Id: flac_format.c,v 1.2 2003/01/12 20:19:22 volsung Exp $
********************************************************************/
......@@ -205,11 +205,11 @@ int flac_read (decoder_t *decoder, void *ptr, int nbytes, int *eos,
decoder->actual_fmt.channels = priv->channels;
decoder->actual_fmt.word_size = ((priv->bits_per_sample + 7) / 8);
print_flac_stream_info(decoder);
if (priv->comments != NULL)
print_flac_comments(&priv->comments->data.vorbis_comment, cb,
decoder->callback_arg);
print_flac_stream_info(decoder);
priv->bos = 0;
}
......
......@@ -11,7 +11,7 @@
* *
********************************************************************
last mod: $Id: format.c,v 1.4 2003/01/11 22:51:44 volsung Exp $
last mod: $Id: format.c,v 1.5 2003/01/12 20:19:22 volsung Exp $
********************************************************************/
......@@ -23,17 +23,24 @@
#include "i18n.h"
extern format_t oggvorbis_format;
extern format_t speex_format;
#ifdef HAVE_LIBFLAC
extern format_t flac_format;
extern format_t oggflac_format;
#endif
#ifdef HAVE_LIBSPEEX
extern format_t speex_format;
#endif
format_t *formats[] = {
#ifdef HAVE_LIBFLAC
&flac_format,
&oggflac_format,
#endif
#ifdef HAVE_LIBSPEEX
&speex_format,
#endif
&oggvorbis_format,
NULL };
......
......@@ -14,7 +14,7 @@
* *
********************************************************************
last mod: $Id: ogg123.c,v 1.65 2002/07/06 19:12:18 volsung Exp $
last mod: $Id: ogg123.c,v 1.66 2003/01/12 20:19:22 volsung Exp $
********************************************************************/
......@@ -416,11 +416,11 @@ void play (char *source_string)
/* Select appropriate callbacks */
if (audio_buffer != NULL) {
decoder_callbacks.printf_error = &decoder_buffered_error_callback;
decoder_callbacks.printf_metadata = &decoder_buffered_error_callback;
decoder_callbacks.printf_metadata = &decoder_buffered_metadata_callback;
decoder_callbacks_arg = audio_buffer;
} else {
decoder_callbacks.printf_error = &decoder_error_callback;
decoder_callbacks.printf_metadata = &decoder_error_callback;
decoder_callbacks.printf_metadata = &decoder_metadata_callback;
decoder_callbacks_arg = NULL;
}
......
......@@ -11,7 +11,7 @@
* *
********************************************************************
last mod: $Id: oggvorbis_format.c,v 1.10 2003/01/11 22:51:44 volsung Exp $
last mod: $Id: oggvorbis_format.c,v 1.11 2003/01/12 20:19:22 volsung Exp $
********************************************************************/
......@@ -124,8 +124,8 @@ int ovf_read (decoder_t *decoder, void *ptr, int nbytes, int *eos,
decoder->actual_fmt.channels = priv->vi->channels;
print_vorbis_comments(priv->vc, cb, decoder->callback_arg);
print_vorbis_stream_info(decoder);
print_vorbis_comments(priv->vc, cb, decoder->callback_arg);
priv->bos = 0;
}
......
This diff is collapsed.
No preview for this file type
No preview for this file type
No preview for this file type
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment