Update for API change in flac-1.1.1. Update requirement in configure.ac. Fixes #162974.

Original commit message from CVS:
* configure.ac:
* ext/flac/gstflacenc.c: (gst_flacenc_init),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_tell_callback), (gst_flacenc_chain),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Update for API change in flac-1.1.1. Update requirement in
configure.ac. Fixes #162974.
This commit is contained in:
Ronald S. Bultje 2005-01-09 20:01:59 +00:00
parent b7e606f7a0
commit 3fc57b4be5
4 changed files with 38 additions and 1 deletions

View file

@ -1,3 +1,14 @@
2005-01-09 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* configure.ac:
* ext/flac/gstflacenc.c: (gst_flacenc_init),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_tell_callback), (gst_flacenc_chain),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Update for API change in flac-1.1.1. Update requirement in
configure.ac. Fixes #162974.
2005-01-09 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/playback/gstplaybasebin.c: (group_destroy):

View file

@ -1064,6 +1064,13 @@ dnl *** FLAC ***
translit(dnm, m, l) AM_CONDITIONAL(USE_FLAC, true)
GST_CHECK_FEATURE(FLAC, [FLAC lossless audio], flacenc flacdec, [
GST_CHECK_LIBHEADER(FLAC, FLAC, FLAC__seekable_stream_encoder_new, -lm, FLAC/all.h, FLAC_LIBS="-lFLAC")
dnl API change in FLAC 1.1.1, so require that...
if test x$HAVE_FLAC = xyes; then
AC_CHECK_DECL(FLAC__SEEKABLE_STREAM_ENCODER_TELL_ERROR,
HAVE_FLAC="yes", HAVE_FLAC="no", [
#include <FLAC/seekable_stream_encoder.h>
])
fi
AC_SUBST(FLAC_LIBS)
])

View file

@ -329,6 +329,7 @@ gst_flacenc_init (FlacEnc * flacenc)
flacenc->encoder = FLAC__seekable_stream_encoder_new ();
flacenc->negotiated = FALSE;
flacenc->offset = 0;
flacenc->first = TRUE;
flacenc->first_buf = NULL;
flacenc->data = NULL;
@ -442,8 +443,10 @@ gst_flacenc_seek_callback (const FLAC__SeekableStreamEncoder * encoder,
gst_event_new_seek ((GstSeekType) (int) (GST_FORMAT_BYTES |
GST_SEEK_METHOD_SET), absolute_byte_offset);
if (event)
if (event) {
gst_pad_push (flacenc->srcpad, GST_DATA (event));
flacenc->offset = absolute_byte_offset;
}
return FLAC__STREAM_ENCODER_OK;
}
@ -472,6 +475,18 @@ gst_flacenc_write_callback (const FLAC__SeekableStreamEncoder * encoder,
}
gst_pad_push (flacenc->srcpad, GST_DATA (outbuf));
flacenc->offset += bytes;
return FLAC__STREAM_ENCODER_OK;
}
static FLAC__SeekableStreamEncoderTellStatus
gst_flacenc_tell_callback (const FLAC__SeekableStreamEncoder * encoder,
FLAC__uint64 * absolute_byte_offset, void *client_data)
{
FlacEnc *flacenc = GST_FLACENC (client_data);
*absolute_byte_offset = flacenc->offset;
return FLAC__STREAM_ENCODER_OK;
}
@ -579,6 +594,8 @@ gst_flacenc_chain (GstPad * pad, GstData * _data)
gst_flacenc_write_callback);
FLAC__seekable_stream_encoder_set_seek_callback (flacenc->encoder,
gst_flacenc_seek_callback);
FLAC__seekable_stream_encoder_set_tell_callback (flacenc->encoder,
gst_flacenc_tell_callback);
FLAC__seekable_stream_encoder_set_client_data (flacenc->encoder, flacenc);
@ -782,6 +799,7 @@ gst_flacenc_change_state (GstElement * element)
FLAC__seekable_stream_encoder_finish (flacenc->encoder);
}
flacenc->negotiated = FALSE;
flacenc->offset = 0;
if (flacenc->first_buf)
gst_buffer_unref (flacenc->first_buf);
flacenc->first_buf = NULL;

View file

@ -46,6 +46,7 @@ struct _FlacEnc {
gboolean first;
GstBuffer *first_buf;
guint64 offset;
gboolean eos;
gint channels;
gint depth;