Commit 3fc57b4b authored by Ronald S. Bultje's avatar Ronald S. Bultje
Browse files

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.
parent b7e606f7
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):
......
......@@ -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)
])
......
......@@ -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;
......
......@@ -46,6 +46,7 @@ struct _FlacEnc {
gboolean first;
GstBuffer *first_buf;
guint64 offset;
gboolean eos;
gint channels;
gint depth;
......
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