Commit 39664502 authored by Led's avatar Led

0.12.1-alt1

parent 3791cdb0
tar.bz2: @version@:. tar.bz2: @version@:.
copy: *.conf copy: *.conf *.patch
object 3e53b9d5b04994a2cfe878bc5649e64c274e5473
type commit
tag 0.12.0
tagger Led <led@altlinux.org> 1226282077 +0200
object 134a9ab30b26e207360301330442a10ed0f8c401
type commit
tag 0.12.1
tagger Led <led@altlinux.org> 1226282087 +0200
08d5fe90e4828cd4abdbfaffc3b08250afcff254 0.12.0 e8b2d77d8357cc43763d5d1fab5aca97da1bc11a 0.12.1
diff -urN mpd-0.12.1.orig/configure.ac mpd-0.12.1/configure.ac
--- mpd-0.12.1.orig/configure.ac 2006-10-11 02:56:58 +0300
+++ mpd-0.12.1/configure.ac 2007-02-26 13:56:57 +0200
@@ -549,9 +549,31 @@
if test x$enable_oggflac = xyes; then
- oldmpdcflags="$MPD_CFLAGS"
- oldmpdlibs="$MPD_LIBS"
- AM_PATH_LIBOGGFLAC(MPD_LIBS="$MPD_LIBS $LIBOGGFLAC_LIBS" MPD_CFLAGS="$MPD_CFLAGS $LIBOGGFLAC_CFLAGS",enable_oggflac=no)
+ # libOggFLAC was merged into libFLAC in FLAC-1.1.3
+ # FLAC_API_SUPPORTS_OGG_FLAC first appears in FLAC-1.1.3
+ oldcflags="$CFLAGS"
+ oldlibs="$LIBS"
+ oldldpath="$LD_LIBRARY_PATH"
+ CFLAGS="$CFLAGS $LIBFLAC_CFLAGS"
+ LIBS="$LIBS $LIBFLAC_LIBS -logg"
+ LD_LIBRARY_PATH="$LIBFLAC_LIBDIR:$LD_LIBRARY_PATH"
+ AC_TRY_RUN([
+#include <FLAC/export.h>
+int main () { return !FLAC_API_SUPPORTS_OGG_FLAC; }
+],oggflac_in_flac=yes,oggflac_in_flac=no,oggflac_in_flac=yes)
+ CFLAGS="$oldcflags"
+ LIBS="$oldlibs"
+ LD_LIBRARY_PATH="$oldldpath"
+ if test x$oggflac_in_flac = xyes; then
+ oldmpdcflags="$MPD_CFLAGS"
+ oldmpdlibs="$MPD_LIBS"
+ MPD_LIBS="$MPD_LIBS $LIBOGGFLAC_LIBS"
+ MPD_CFLAGS="$MPD_CFLAGS $LIBOGGFLAC_CFLAGS"
+ else
+ oldmpdcflags="$MPD_CFLAGS"
+ oldmpdlibs="$MPD_LIBS"
+ AM_PATH_LIBOGGFLAC(MPD_LIBS="$MPD_LIBS $LIBOGGFLAC_LIBS" MPD_CFLAGS="$MPD_CFLAGS $LIBOGGFLAC_CFLAGS",enable_oggflac=no)
+ fi
fi
if test x$enable_oggflac = xyes; then
diff -urN mpd-0.12.1.orig/src/inputPlugins/_flac_common.h mpd-0.12.1/src/inputPlugins/_flac_common.h
--- mpd-0.12.1.orig/src/inputPlugins/_flac_common.h 2006-10-11 02:56:55 +0300
+++ mpd-0.12.1/src/inputPlugins/_flac_common.h 2007-02-26 13:56:57 +0200
@@ -30,7 +30,14 @@
#include "../inputStream.h"
#include "../outputBuffer.h"
#include "../decode.h"
+#include <FLAC/export.h>
+#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8
#include <FLAC/seekable_stream_decoder.h>
+#define LEGACY_FLAC
+#else
+#include <FLAC/stream_decoder.h>
+#undef LEGACY_FLAC
+#endif
#include <FLAC/metadata.h>
#define FLAC_CHUNK_SIZE 4080
diff -urN mpd-0.12.1.orig/src/inputPlugins/flac_plugin.c mpd-0.12.1/src/inputPlugins/flac_plugin.c
--- mpd-0.12.1.orig/src/inputPlugins/flac_plugin.c 2006-10-11 02:56:56 +0300
+++ mpd-0.12.1/src/inputPlugins/flac_plugin.c 2007-02-26 13:56:57 +0200
@@ -33,11 +33,16 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#ifdef LEGACY_FLAC
#include <FLAC/seekable_stream_decoder.h>
+#else
+#include <FLAC/stream_decoder.h>
+#endif
#include <FLAC/metadata.h>
/* this code is based on flac123, from flac-tools */
+#ifdef LEGACY_FLAC
static void flacError(const FLAC__SeekableStreamDecoder *,
FLAC__StreamDecoderErrorStatus, void *);
static void flacPrintErroredState(FLAC__SeekableStreamDecoderState state);
@@ -64,21 +69,41 @@
*, FLAC__uint64 *,
void *);
static FLAC__bool flacEOF(const FLAC__SeekableStreamDecoder *, void *);
+#else
+static void flacError(const FLAC__StreamDecoder *, FLAC__StreamDecoderErrorStatus, void *);
+static void flacPrintErroredState(FLAC__StreamDecoderState state);
+static void flacMetadata(const FLAC__StreamDecoder *, const FLAC__StreamMetadata *, void *);
+static FLAC__StreamDecoderWriteStatus flacWrite(const FLAC__StreamDecoder *, const FLAC__Frame *, const FLAC__int32 * const buf[], void *);
+static FLAC__StreamDecoderReadStatus flacRead(const FLAC__StreamDecoder *, FLAC__byte buf[], size_t *, void *);
+static FLAC__StreamDecoderSeekStatus flacSeek(const FLAC__StreamDecoder *, FLAC__uint64, void *);
+static FLAC__StreamDecoderTellStatus flacTell(const FLAC__StreamDecoder *, FLAC__uint64 *, void *);
+static FLAC__StreamDecoderLengthStatus flacLength(const FLAC__StreamDecoder *, FLAC__uint64 *, void *);
+static FLAC__bool flacEOF(const FLAC__StreamDecoder *, void *);
+#endif
static int flac_decode(OutputBuffer * cb, DecoderControl * dc,
InputStream * inStream)
{
+#ifdef LEGACY_FLAC
FLAC__SeekableStreamDecoder *flacDec = NULL;
+#else
+ FLAC__StreamDecoder *flacDec = NULL;
+#endif
FlacData data;
int status = 1;
int ret = 0;
init_FlacData(&data, cb, dc, inStream);
+#ifdef LEGACY_FLAC
if (!(flacDec = FLAC__seekable_stream_decoder_new())) {
+#else
+ if (!(flacDec = FLAC__stream_decoder_new())) {
+#endif
ret = -1;
goto fail;
}
+#ifdef LEGACY_FLAC
/*status&=FLAC__file_decoder_set_md5_checking(flacDec,1); */
status &= FLAC__seekable_stream_decoder_set_read_callback(flacDec,
flacRead);
@@ -98,34 +123,56 @@
flacMetadata);
status &=
FLAC__seekable_stream_decoder_set_metadata_respond(flacDec,
+#else
+ /*status&=FLAC__stream_decoder_set_md5_checking(flacDec,1); */
+ status &= FLAC__stream_decoder_set_metadata_respond(flacDec,
+#endif
FLAC__METADATA_TYPE_VORBIS_COMMENT);
+#ifdef LEGACY_FLAC
status &=
FLAC__seekable_stream_decoder_set_error_callback(flacDec,
flacError);
status &=
FLAC__seekable_stream_decoder_set_client_data(flacDec,
(void *)&data);
+#endif
if (!status) {
ERROR("flac problem before init()\n");
+#ifdef LEGACY_FLAC
flacPrintErroredState(FLAC__seekable_stream_decoder_get_state
+#else
+ flacPrintErroredState(FLAC__stream_decoder_get_state
+#endif
(flacDec));
ret = -1;
goto fail;
}
+#ifdef LEGACY_FLAC
if (FLAC__seekable_stream_decoder_init(flacDec) !=
FLAC__SEEKABLE_STREAM_DECODER_OK) {
ERROR("flac problem doing init()\n");
flacPrintErroredState(FLAC__seekable_stream_decoder_get_state
+#else
+ if (FLAC__stream_decoder_init_stream(flacDec, flacRead, flacSeek, flacTell, flacLength, flacEOF, flacWrite, flacMetadata, flacError, (void *)&data) != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
+ ERROR("flac problem doing init()\n");
+ flacPrintErroredState(FLAC__stream_decoder_get_state
+#endif
(flacDec));
ret = -1;
goto fail;
}
+#ifdef LEGACY_FLAC
if (!FLAC__seekable_stream_decoder_process_until_end_of_metadata
(flacDec)) {
ERROR("flac problem reading metadata\n");
flacPrintErroredState(FLAC__seekable_stream_decoder_get_state
+#else
+ if (!FLAC__stream_decoder_process_until_end_of_metadata(flacDec)) {
+ ERROR("flac problem reading metadata\n");
+ flacPrintErroredState(FLAC__stream_decoder_get_state
+#endif
(flacDec));
ret = -1;
goto fail;
@@ -134,16 +181,26 @@
dc->state = DECODE_STATE_DECODE;
while (1) {
+#ifdef LEGACY_FLAC
FLAC__seekable_stream_decoder_process_single(flacDec);
if (FLAC__seekable_stream_decoder_get_state(flacDec) !=
FLAC__SEEKABLE_STREAM_DECODER_OK) {
+#else
+ FLAC__stream_decoder_process_single(flacDec);
+ if (FLAC__stream_decoder_get_state(flacDec) > FLAC__STREAM_DECODER_READ_FRAME) {
+#endif
break;
}
if (dc->seek) {
FLAC__uint64 sampleToSeek = dc->seekWhere *
dc->audioFormat.sampleRate + 0.5;
+#ifdef LEGACY_FLAC
if (FLAC__seekable_stream_decoder_seek_absolute(flacDec,
+#else
+ if (FLAC__stream_decoder_seek_absolute(flacDec,
+#endif
sampleToSeek))
+
{
clearOutputBuffer(cb);
data.time = ((float)sampleToSeek) /
@@ -157,9 +214,14 @@
/* I don't think we need this bit here! -shank */
/*FLAC__file_decoder_process_until_end_of_file(flacDec); */
if (!dc->stop) {
+#ifdef LEGACY_FLAC
flacPrintErroredState(FLAC__seekable_stream_decoder_get_state
(flacDec));
FLAC__seekable_stream_decoder_finish(flacDec);
+#else
+ flacPrintErroredState(FLAC__stream_decoder_get_state(flacDec));
+ FLAC__stream_decoder_finish(flacDec);
+#endif
}
/* send last little bit */
if (data.chunk_length > 0 && !dc->stop) {
@@ -180,18 +242,26 @@
freeReplayGainInfo(data.replayGainInfo);
if (flacDec)
+#ifdef LEGACY_FLAC
FLAC__seekable_stream_decoder_delete(flacDec);
+#else
+ FLAC__stream_decoder_delete(flacDec);
+#endif
closeInputStream(inStream);
return ret;
}
+#ifdef LEGACY_FLAC
static FLAC__SeekableStreamDecoderReadStatus flacRead(const
FLAC__SeekableStreamDecoder
* flacDec,
FLAC__byte buf[],
unsigned *bytes,
+#else
+static FLAC__StreamDecoderReadStatus flacRead(const FLAC__StreamDecoder* flacDec, FLAC__byte buf[], size_t *bytes,
+#endif
void *fdata)
{
FlacData *data = (FlacData *) fdata;
@@ -208,13 +278,23 @@
*bytes = r;
if (*bytes == 0 && !inputStreamAtEOF(data->inStream) && !data->dc->stop)
+#ifdef LEGACY_FLAC
return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR;
return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK;
+#else
+ return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
+
+ return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
+#endif
}
+#ifdef LEGACY_FLAC
static FLAC__SeekableStreamDecoderSeekStatus flacSeek(const
FLAC__SeekableStreamDecoder
+#else
+static FLAC__StreamDecoderSeekStatus flacSeek(const FLAC__StreamDecoder
+#endif
* flacDec,
FLAC__uint64 offset,
void *fdata)
@@ -222,14 +302,26 @@
FlacData *data = (FlacData *) fdata;
if (seekInputStream(data->inStream, offset, SEEK_SET) < 0) {
+#ifdef LEGACY_FLAC
return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR;
+#else
+ return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
+#endif
}
+#ifdef LEGACY_FLAC
return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK;
+#else
+ return FLAC__STREAM_DECODER_SEEK_STATUS_OK;
+#endif
}
+#ifdef LEGACY_FLAC
static FLAC__SeekableStreamDecoderTellStatus flacTell(const
FLAC__SeekableStreamDecoder
+#else
+static FLAC__StreamDecoderTellStatus flacTell(const FLAC__StreamDecoder
+#endif
* flacDec,
FLAC__uint64 * offset,
void *fdata)
@@ -238,11 +330,19 @@
*offset = (long)(data->inStream->offset);
+#ifdef LEGACY_FLAC
return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK;
+#else
+ return FLAC__STREAM_DECODER_TELL_STATUS_OK;
+#endif
}
+#ifdef LEGACY_FLAC
static FLAC__SeekableStreamDecoderLengthStatus flacLength(const
FLAC__SeekableStreamDecoder
+#else
+static FLAC__StreamDecoderLengthStatus flacLength(const FLAC__StreamDecoder
+#endif
* flacDec,
FLAC__uint64 * length,
void *fdata)
@@ -251,10 +351,18 @@
*length = (size_t) (data->inStream->size);
+#ifdef LEGACY_FLAC
return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK;
+#else
+ return FLAC__STREAM_DECODER_LENGTH_STATUS_OK;
+#endif
}
+#ifdef LEGACY_FLAC
static FLAC__bool flacEOF(const FLAC__SeekableStreamDecoder * flacDec,
+#else
+static FLAC__bool flacEOF(const FLAC__StreamDecoder * flacDec,
+#endif
void *fdata)
{
FlacData *data = (FlacData *) fdata;
@@ -264,12 +372,17 @@
return false;
}
+#ifdef LEGACY_FLAC
static void flacError(const FLAC__SeekableStreamDecoder * dec,
+#else
+static void flacError(const FLAC__StreamDecoder * dec,
+#endif
FLAC__StreamDecoderErrorStatus status, void *fdata)
{
flac_error_common_cb("flac", status, (FlacData *) fdata);
}
+#ifdef LEGACY_FLAC
static void flacPrintErroredState(FLAC__SeekableStreamDecoderState state)
{
switch (state) {
@@ -299,16 +412,29 @@
case FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM:
break;
}
+#else
+static void flacPrintErroredState(FLAC__StreamDecoderState state)
+{
+ ERROR("%s\n", FLAC__StreamDecoderStateString[state]);
+#endif
}
+#ifdef LEGACY_FLAC
static void flacMetadata(const FLAC__SeekableStreamDecoder * dec,
+#else
+static void flacMetadata(const FLAC__StreamDecoder * dec,
+#endif
const FLAC__StreamMetadata * block, void *vdata)
{
flac_metadata_common_cb(block, (FlacData *) vdata);
}
+#ifdef LEGACY_FLAC
static FLAC__StreamDecoderWriteStatus flacWrite(const
FLAC__SeekableStreamDecoder *
+#else
+static FLAC__StreamDecoderWriteStatus flacWrite(const FLAC__StreamDecoder *
+#endif
dec, const FLAC__Frame * frame,
const FLAC__int32 * const buf[],
void *vdata)
@@ -325,7 +451,11 @@
timeChange = ((float)samples) / frame->header.sample_rate;
data->time += timeChange;
+#ifdef LEGACY_FLAC
FLAC__seekable_stream_decoder_get_decode_position(dec, &newPosition);
+#else
+ FLAC__stream_decoder_get_decode_position(dec, &newPosition);
+#endif
if (data->position) {
data->bitRate =
((newPosition - data->position) * 8.0 / timeChange)
diff -urN mpd-0.12.1.orig/src/inputPlugins/oggflac_plugin.c mpd-0.12.1/src/inputPlugins/oggflac_plugin.c
--- mpd-0.12.1.orig/src/inputPlugins/oggflac_plugin.c 2006-10-11 02:56:55 +0300
+++ mpd-0.12.1/src/inputPlugins/oggflac_plugin.c 2007-02-26 13:59:35 +0200
@@ -37,25 +37,41 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#ifdef LEGACY_FLAC
#include <OggFLAC/seekable_stream_decoder.h>
+#else
+#include <FLAC/stream_decoder.h>
+#endif
#include <FLAC/metadata.h>
static void oggflac_cleanup(InputStream * inStream,
FlacData * data,
+#ifdef LEGACY_FLAC
OggFLAC__SeekableStreamDecoder * decoder)
+#else
+ FLAC__StreamDecoder * decoder)
+#endif
{
if (data->replayGainInfo)
freeReplayGainInfo(data->replayGainInfo);
if (decoder)
+#ifdef LEGACY_FLAC
OggFLAC__seekable_stream_decoder_delete(decoder);
+#else
+ FLAC__stream_decoder_delete(decoder);
+#endif
closeInputStream(inStream);
}
+#ifdef LEGACY_FLAC
static OggFLAC__SeekableStreamDecoderReadStatus of_read_cb(const
OggFLAC__SeekableStreamDecoder
* decoder,
FLAC__byte buf[],
unsigned *bytes,
+#else
+static FLAC__StreamDecoderReadStatus of_read_cb(const FLAC__StreamDecoder* decoder, FLAC__byte buf[], size_t *bytes,
+#endif
void *fdata)
{
FlacData *data = (FlacData *) fdata;
@@ -71,14 +87,28 @@
}
*bytes = r;
+#ifdef LEGACY_FLAC
if (r == 0 && !inputStreamAtEOF(data->inStream) && !data->dc->stop)
return OggFLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR;
return OggFLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK;
+#else
+ if (r == 0 && !data->dc->stop) {
+ if (inputStreamAtEOF(data->inStream))
+ return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
+ else
+ return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
+ }
+ return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
+#endif
}
+#ifdef LEGACY_FLAC
static OggFLAC__SeekableStreamDecoderSeekStatus of_seek_cb(const
OggFLAC__SeekableStreamDecoder
+#else
+static FLAC__StreamDecoderSeekStatus of_seek_cb(const FLAC__StreamDecoder
+#endif
* decoder,
FLAC__uint64 offset,
void *fdata)
@@ -86,40 +116,70 @@
FlacData *data = (FlacData *) fdata;
if (seekInputStream(data->inStream, offset, SEEK_SET) < 0) {
+#ifdef LEGACY_FLAC
return OggFLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR;
+#else
+ return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
+#endif
}
+#ifdef LEGACY_FLAC
return OggFLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK;
+#else
+ return FLAC__STREAM_DECODER_SEEK_STATUS_OK;
+#endif
}
+#ifdef LEGACY_FLAC
static OggFLAC__SeekableStreamDecoderTellStatus of_tell_cb(const
OggFLAC__SeekableStreamDecoder
+#else
+static FLAC__StreamDecoderTellStatus of_tell_cb(const FLAC__StreamDecoder
+#endif
* decoder,
FLAC__uint64 *
offset, void *fdata)
+
{
FlacData *data = (FlacData *) fdata;
*offset = (long)(data->inStream->offset);
+#ifdef LEGACY_FLAC
return OggFLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK;
+#else
+ return FLAC__STREAM_DECODER_TELL_STATUS_OK;
+#endif
}
+#ifdef LEGACY_FLAC
static OggFLAC__SeekableStreamDecoderLengthStatus of_length_cb(const
OggFLAC__SeekableStreamDecoder
+#else
+static FLAC__StreamDecoderLengthStatus of_length_cb(const FLAC__StreamDecoder
+#endif
* decoder,
FLAC__uint64 *
length,
void *fdata)
+
{
FlacData *data = (FlacData *) fdata;
*length = (size_t) (data->inStream->size);
+#ifdef LEGACY_FLAC
return OggFLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK;
+#else
+ return FLAC__STREAM_DECODER_LENGTH_STATUS_OK;
+#endif
}
+#ifdef LEGACY_FLAC
static FLAC__bool of_EOF_cb(const OggFLAC__SeekableStreamDecoder * decoder,
+#else
+static FLAC__bool of_EOF_cb(const FLAC__StreamDecoder * decoder,
+#endif
void *fdata)
{
FlacData *data = (FlacData *) fdata;
@@ -129,12 +189,17 @@
return false;
}
+#ifdef LEGACY_FLAC
static void of_error_cb(const OggFLAC__SeekableStreamDecoder * decoder,
+#else
+static void of_error_cb(const FLAC__StreamDecoder * decoder,
+#endif
FLAC__StreamDecoderErrorStatus status, void *fdata)
{
flac_error_common_cb("oggflac", status, (FlacData *) fdata);
}
+#ifdef LEGACY_FLAC
static void oggflacPrintErroredState(OggFLAC__SeekableStreamDecoderState state)
{
switch (state) {
@@ -164,10 +229,19 @@
case OggFLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM:
break;
}
+#else
+static void oggflacPrintErroredState(FLAC__StreamDecoderState state)
+{
+ ERROR("%s\n", FLAC__StreamDecoderStateString[state]);
+#endif
}
+#ifdef LEGACY_FLAC
static FLAC__StreamDecoderWriteStatus oggflacWrite(const
OggFLAC__SeekableStreamDecoder
+#else
+static FLAC__StreamDecoderWriteStatus oggflacWrite(const FLAC__StreamDecoder
+#endif
* decoder,
const FLAC__Frame * frame,
const FLAC__int32 *
@@ -222,7 +296,11 @@
}
/* used by TagDup */
+#ifdef LEGACY_FLAC
static void of_metadata_dup_cb(const OggFLAC__SeekableStreamDecoder * decoder,
+#else
+static void of_metadata_dup_cb(const FLAC__StreamDecoder * decoder,
+#endif
const FLAC__StreamMetadata * block, void *vdata)
{
FlacData *data = (FlacData *) vdata;
@@ -243,24 +321,41 @@
}
/* used by decode */
+#ifdef LEGACY_FLAC
static void of_metadata_decode_cb(const OggFLAC__SeekableStreamDecoder * dec,
+#else
+static void of_metadata_decode_cb(const FLAC__StreamDecoder * dec,
+#endif
const FLAC__StreamMetadata * block,
void *vdata)
{
flac_metadata_common_cb(block, (FlacData *) vdata);
}
+#ifdef LEGACY_FLAC
static OggFLAC__SeekableStreamDecoder
+#else
+static FLAC__StreamDecoder
+#endif
* full_decoder_init_and_read_metadata(FlacData * data,
unsigned int metadata_only)
{
+#ifdef LEGACY_FLAC
OggFLAC__SeekableStreamDecoder *decoder = NULL;
+#else
+ FLAC__StreamDecoder *decoder = NULL;
+#endif
unsigned int s = 1;
+#ifdef LEGACY_FLAC
if (!(decoder = OggFLAC__seekable_stream_decoder_new()))
+#else
+ if (!(decoder = FLAC__stream_decoder_new()))
+#endif
return NULL;
if (metadata_only) {
+#ifdef LEGACY_FLAC
s &= OggFLAC__seekable_stream_decoder_set_metadata_callback
(decoder, of_metadata_dup_cb);
s &= OggFLAC__seekable_stream_decoder_set_metadata_respond
@@ -288,17 +383,32 @@
of_error_cb);
s &= OggFLAC__seekable_stream_decoder_set_client_data(decoder,
(void *)data);
+#else
+ s &= FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_STREAMINFO);
+ }
+
+ s &= FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT);
+#endif
if (!s) {
ERROR("oggflac problem before init()\n");
goto fail;
}
+
+#ifdef LEGACY_FLAC
if (OggFLAC__seekable_stream_decoder_init(decoder) !=
OggFLAC__SEEKABLE_STREAM_DECODER_OK) {
+#else
+ if (FLAC__stream_decoder_init_ogg_stream(decoder, of_read_cb, of_seek_cb, of_tell_cb, of_length_cb, of_EOF_cb, oggflacWrite, metadata_only? of_metadata_dup_cb : of_metadata_decode_cb, of_error_cb, (void *)data) != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
+#endif
ERROR("oggflac problem doing init()\n");
goto fail;
}
+#ifdef LEGACY_FLAC
if (!OggFLAC__seekable_stream_decoder_process_until_end_of_metadata
+#else
+ if (!FLAC__stream_decoder_process_until_end_of_metadata
+#endif
(decoder)) {
ERROR("oggflac problem reading metadata\n");
goto fail;
@@ -307,9 +417,14 @@
return decoder;
fail:
+#ifdef LEGACY_FLAC
oggflacPrintErroredState(OggFLAC__seekable_stream_decoder_get_state
(decoder));
OggFLAC__seekable_stream_decoder_delete(decoder);
+#else
+ oggflacPrintErroredState(FLAC__stream_decoder_get_state(decoder));
+ FLAC__stream_decoder_delete(decoder);
+#endif
return NULL;
}
@@ -317,7 +432,11 @@
static MpdTag *oggflac_TagDup(char *file)
{
InputStream inStream;
+#ifdef LEGACY_FLAC
OggFLAC__SeekableStreamDecoder *decoder;
+#else
+ FLAC__StreamDecoder *decoder;
+#endif
FlacData data;
if (openInputStream(&inStream, file) < 0)
@@ -346,7 +465,11 @@
static int oggflac_decode(OutputBuffer * cb, DecoderControl * dc,
InputStream * inStream)
{
+#ifdef LEGACY_FLAC
OggFLAC__SeekableStreamDecoder *decoder = NULL;
+#else
+ FLAC__StreamDecoder *decoder = NULL;
+#endif
FlacData data;
int ret = 0;
@@ -360,15 +483,25 @@
dc->state = DECODE_STATE_DECODE;
while (1) {
+#ifdef LEGACY_FLAC
OggFLAC__seekable_stream_decoder_process_single(decoder);
if (OggFLAC__seekable_stream_decoder_get_state(decoder) !=
OggFLAC__SEEKABLE_STREAM_DECODER_OK) {
+#else
+ FLAC__stream_decoder_process_single(decoder);
+ if (FLAC__stream_decoder_get_state(decoder) >
+ FLAC__STREAM_DECODER_READ_FRAME) {
+#endif
break;
}
if (dc->seek) {
FLAC__uint64 sampleToSeek = dc->seekWhere *
dc->audioFormat.sampleRate + 0.5;
+#ifdef LEGACY_FLAC
if (OggFLAC__seekable_stream_decoder_seek_absolute
+#else
+ if (FLAC__stream_decoder_seek_absolute
+#endif
(decoder, sampleToSeek)) {
clearOutputBuffer(cb);
data.time = ((float)sampleToSeek) /
@@ -381,9 +514,14 @@
}
if (!dc->stop) {
+#ifdef LEGACY_FLAC
oggflacPrintErroredState
(OggFLAC__seekable_stream_decoder_get_state(decoder));
OggFLAC__seekable_stream_decoder_finish(decoder);
+#else
+ oggflacPrintErroredState(FLAC__stream_decoder_get_state(decoder));
+ FLAC__stream_decoder_finish(decoder);
+#endif
}
/* send last little bit */
if (data.chunk_length > 0 && !dc->stop) {
diff -urN mpd-0.12.1.orig/configure mpd-0.12.1/configure
--- mpd-0.12.1.orig/configure 2006-10-11 02:57:30 +0300
+++ mpd-0.12.1/configure 2007-01-10 18:56:56 +0200
@@ -18970,7 +18970,13 @@
# Check whether --with-tremor or --without-tremor was given.
if test "${with_tremor+set}" = set; then
withval="$with_tremor"
- use_tremor=yes; test x$withval != xyes && tremor_prefix="$withval"
+ if test "x$withval" = xyes -o "x$withval" = xno; then
+ use_tremor="$withval"
+ else
+ use_tremor=yes
+ tremor_prefix="$withval"
+ fi
+
fi;
# Check whether --with-tremor-libraries or --without-tremor-libraries was given.
diff -urN mpd-0.12.1.orig/configure.ac mpd-0.12.1/configure.ac
--- mpd-0.12.1.orig/configure.ac 2006-10-11 02:56:58 +0300
+++ mpd-0.12.1/configure.ac 2007-01-10 18:56:28 +0200
@@ -81,7 +81,14 @@
AC_ARG_ENABLE(mpc,[ --disable-mpc disable musepack (MPC) support (default: enable)],[enable_mpc=$enableval],[enable_mpc=yes])
AC_ARG_ENABLE(id3,[ --disable-id3 disable id3 support (default: enable)],[enable_id3=$enableval],[enable_id3=yes])
-AC_ARG_WITH(tremor,[[ --with-tremor[=PFX] Use Tremor(vorbisidec) integer Ogg-Vorbis decoder (with optional prefix)]], use_tremor=yes; test x$withval != xyes && tremor_prefix="$withval",)
+AC_ARG_WITH(tremor,[[ --with-tremor[=PFX] Use Tremor(vorbisidec) integer Ogg-Vorbis decoder (with optional prefix)]],
+ if test "x$withval" = xyes -o "x$withval" = xno; then
+ use_tremor="$withval"
+ else
+ use_tremor=yes
+ tremor_prefix="$withval"
+ fi
+,)
AC_ARG_WITH(tremor-libraries,[ --with-tremor-libraries=DIR Directory where Tremor library is installed (optional)], tremor_libraries="$withval", tremor_libraries="")
AC_ARG_WITH(tremor-includes,[ --with-tremor-includes=DIR Directory where Tremor header files are installed (optional)], tremor_includes="$withval", tremor_includes="")
Name: mpd %def_with pic
Version: 0.12.0
Release: alt1
Summary: Music Player Daemon (MPD) allows remote access for playing music and managing playlists. %def_enable ao
License: GPL %def_enable shout
Group: Sound %def_enable iconv
%def_disable ipv6
%def_disable sun
%def_enable oss
%def_enable alsa
%def_enable pulse
%def_enable mvp
%def_enable oggvorbis
%def_enable oggflac
%def_enable flac
%def_enable mp3
%def_enable aac
%def_enable audiofile
%def_enable mod
%def_enable faad
%def_enable mpc
%def_enable id3
%def_without tremor
#----------------------------------------------------------------------
%define set_disable() %{expand:%%force_disable %{1}} %{expand:%%undefine _enable_%{1}}
Url: http://musicpd.org/ %if_with tremor
%set_disable shout
%set_disable oggflac
%endif
Source: %name-%version.tar.bz2 Name: mpd
Source1: %name.conf Version: 0.12.1
Release: alt1
Summary: Music Player Daemon (MPD) allows remote access for playing music and managing playlists.
License: GPL
Group: Sound
URL: http://musicpd.org/
Source0: http://musicpd.org/uploads/files/%name-%version.tar.bz2
Source1: %name.conf
Patch0: %name-0.12.1-configure.patch
Patch1: mpd-0.12.1+flac-1.1.3.patch
# Automatically added by buildreq on Wed Jan 10 2007
BuildRequires: gcc-c++ zlib-devel
# Automatically added by buildreq on Fri Sep 15 2006 %{?_enable_alsa:BuildRequires: libalsa-devel >= 0.9.0}
BuildRequires: libalsa-devel libaudiofile-devel libfaad-devel libflac-devel libid3tag-devel libmad-devel libmikmod-devel libmpcdec-devel liboggflac-devel libpulseaudio-devel libvorbis-devel zlib-devel libao-devel %{?_enable_ao:BuildRequires: libao-devel}
%{?_enable_shout:BuildRequires: libshout-devel}
%{?_enable_audiofile:BuildRequires: libaudiofile-devel >= 0.1.7}
%{?_enable_mod:BuildRequires: libmikmod-devel >= 3.1.7}
%{?_enable_faad:BuildRequires: libfaad-devel}
%{?_enable_flac:BuildRequires: libflac-devel}
%{?_enable_oggflac:BuildRequires: liboggflac-devel}
%{?_enable_id3:BuildRequires: libid3tag-devel}
%{?_enable_mp3:BuildRequires: libmad-devel}
%{?_enable_mpc:BuildRequires: libmpcdec-devel}
%{?_enable_pulse:BuildRequires: libpulseaudio-devel}
%{?_enable_oggvorbis:BuildRequires: libvorbis-devel}
%description %description
Music Player Daemon (MPD) allows remote access for playing music
(MP3, Ogg Vorbis, FLAC, AAC, Mod, and wave files) and managing
playlists. MPD is designed for integrating a computer into a stereo
system that provides control for music playback over a local network.
It is also makes a great desktop music player, especially if you are a
console junkie, like frontend options, or restart X often.
Music Player Daemon (MPD) allows remote access for playing music
(MP3, Ogg Vorbis, FLAC, AAC, Mod, and wave files) and managing playlists.
MPD is designed for integrating a computer into a stereo system that
provides control for music playback over a local network. It is also
makes a great desktop music player, especially if you are a console junkie,
like frontend options, or restart X often.
%prep %prep
%setup -q %setup -q
%patch0 -p1
%patch1 -p1
touch aclocal.m4
%build %build
%configure --enable-ao \ autoconf -v -i -f
--enable-mod \ %configure \
--enable-mp3 \ %{subst_with pic} \
--enable-mpc \ %{subst_with tremor} \
--enable-mvp \ %{subst_enable ao} \
--enable-oggvorbis \ %{subst_enable shout} \
--enable-oss \ %{subst_enable iconv} \
--enable-pulse %{subst_enable ipv6} \
%{subst_enable sun} \
%{subst_enable oss} \
%{subst_enable alsa} \
%{subst_enable pulse} \
%{subst_enable mvp} \
%{subst_enable oggvorbis} \
%{subst_enable flac} \
%{subst_enable oggflac} \
%{subst_enable mp3} \
%{subst_enable aac} \
%{subst_enable audiofile} \
%{subst_enable mod} \
%{subst_enable mpc} \
%{subst_enable id3} \
--disable-libOggFLACtest
%make_build %make_build
%install %install
%makeinstall %make_install DESTDIR=%buildroot docdir=%_docdir/%name-%version install
%__mkdir %buildroot%_sysconfdir install -pD -m 0644 %SOURCE1 %buildroot%_sysconfdir/%name.conf
%__install -p -m644 %SOURCE1 %buildroot%_sysconfdir bzip2 --best --keep --force ChangeLog
%files %files
%doc AUTHORS ChangeLog COPYING INSTALL README TODO UPGRADING doc/{mpdconf.example,COMMANDS} %doc AUTHORS ChangeLog.* README TODO UPGRADING doc/{%{name}conf.example,COMMANDS}
%config(noreplace) %_sysconfdir/%name.conf %config(noreplace) %_sysconfdir/*
%_bindir/%name %_bindir/*
%_man1dir/%name.1.gz %_man1dir/*
%_man5dir/%name.conf.5.gz %_man5dir/*
%changelog %changelog
* Mon Feb 26 2007 Led <led@altlinux.ru> 0.12.1-alt1
- NMU (fixed #10874)
- 0.12.1
- fixed BuildRequires
- added %name-0.12.1-configure.patch
- added mpd-0.12.1+flac-1.1.3.patch
- cleaned up spec
* Mon Sep 25 2006 Alex Gorbachenko (agent_007) <algor@altlinux.ru> 0.12.0-alt1 * Mon Sep 25 2006 Alex Gorbachenko (agent_007) <algor@altlinux.ru> 0.12.0-alt1
- 0.12. - 0.12
* Fri Sep 15 2006 Alex Gorbachenko (agent_007) <algor@altlinux.ru> 0.12.0rc4-alt1 * Fri Sep 15 2006 Alex Gorbachenko (agent_007) <algor@altlinux.ru> 0.12.0rc4-alt1
- 0.12.0rc4. - 0.12.0rc4.
......
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