ref: 266f197cddf52fab1fdb8336498026cca0c5de5a
parent: c430d8fcbea071d56735527a35a980132b9b66c2
author: Mans Rullgard <mans@mansr.com>
date: Thu Aug 20 20:49:36 EDT 2020
flac: fix error message on encoder init failure
--- a/src/flac.c
+++ b/src/flac.c
@@ -390,7 +390,7 @@
static int start_write(sox_format_t * const ft)
{
priv_t * p = (priv_t *)ft->priv;
- FLAC__StreamEncoderState status;
+ FLAC__StreamEncoderInitStatus status;
unsigned compression_level = MAX_COMPRESSION; /* Default to "best" */
if (ft->encoding.compression != HUGE_VAL) {
@@ -515,8 +515,8 @@
status = FLAC__stream_encoder_init_stream(p->encoder, flac_stream_encoder_write_callback,
flac_stream_encoder_seek_callback, flac_stream_encoder_tell_callback, flac_stream_encoder_metadata_callback, ft);
- if (status != FLAC__STREAM_ENCODER_OK) {
- lsx_fail_errno(ft, SOX_EINVAL, "%s", FLAC__StreamEncoderStateString[status]);
+ if (status != FLAC__STREAM_ENCODER_INIT_STATUS_OK) {
+ lsx_fail_errno(ft, SOX_EINVAL, "%s", FLAC__StreamEncoderInitStatusString[status]);
return SOX_EOF;
}
return SOX_SUCCESS;