encoder/shine: require libshine 3.1, adapt to new API
The "written" argument to shine_encode_buffer() and shine_flush() was changed from "long" to "int", which breaks API and ABI compatibility. This is a big deal, and it doesn't seem worthwile to keep support for the (broken) 3.0 release.
This commit is contained in:
@ -1447,7 +1447,7 @@ AM_CONDITIONAL(ENABLE_FLAC_ENCODER, test x$enable_flac_encoder = xyes)
|
|||||||
|
|
||||||
dnl ------------------------------- Shine Encoder ------------------------------
|
dnl ------------------------------- Shine Encoder ------------------------------
|
||||||
|
|
||||||
MPD_AUTO_PKG(shine_encoder, SHINE, [shine >= 3],
|
MPD_AUTO_PKG(shine_encoder, SHINE, [shine >= 3.1],
|
||||||
[shine encoder], [libshine not found])
|
[shine encoder], [libshine not found])
|
||||||
|
|
||||||
if test x$enable_shine_encoder = xyes; then
|
if test x$enable_shine_encoder = xyes; then
|
||||||
|
@ -172,8 +172,6 @@ bool
|
|||||||
ShineEncoder::WriteChunk(bool flush)
|
ShineEncoder::WriteChunk(bool flush)
|
||||||
{
|
{
|
||||||
if (flush || input_pos == frame_size) {
|
if (flush || input_pos == frame_size) {
|
||||||
long written;
|
|
||||||
|
|
||||||
if (flush) {
|
if (flush) {
|
||||||
/* fill remaining with 0s */
|
/* fill remaining with 0s */
|
||||||
for (; input_pos < frame_size; input_pos++) {
|
for (; input_pos < frame_size; input_pos++) {
|
||||||
@ -181,6 +179,7 @@ ShineEncoder::WriteChunk(bool flush)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int written;
|
||||||
const uint8_t *out =
|
const uint8_t *out =
|
||||||
shine_encode_buffer(shine, stereo, &written);
|
shine_encode_buffer(shine, stereo, &written);
|
||||||
|
|
||||||
@ -229,10 +228,11 @@ static bool
|
|||||||
shine_encoder_flush(Encoder *_encoder, gcc_unused Error &error)
|
shine_encoder_flush(Encoder *_encoder, gcc_unused Error &error)
|
||||||
{
|
{
|
||||||
ShineEncoder *encoder = (ShineEncoder *)_encoder;
|
ShineEncoder *encoder = (ShineEncoder *)_encoder;
|
||||||
long written;
|
|
||||||
|
|
||||||
/* flush buffers and flush shine */
|
/* flush buffers and flush shine */
|
||||||
encoder->WriteChunk(true);
|
encoder->WriteChunk(true);
|
||||||
|
|
||||||
|
int written;
|
||||||
const uint8_t *data = shine_flush(encoder->shine, &written);
|
const uint8_t *data = shine_flush(encoder->shine, &written);
|
||||||
|
|
||||||
if (written > 0)
|
if (written > 0)
|
||||||
|
Reference in New Issue
Block a user