[9front] audio/flacenc: fix error check for fseeko

fseeko returns 0 on success, not the new stream position.

This allows flacenc to update the streaminfo block when it is finished
(for example to set the number of samples and checksum).
This commit is contained in:
Michael Forney 2021-02-11 09:37:36 +01:00
parent f2974b6cfa
commit 5fd4fa912e

View file

@ -18,7 +18,7 @@ encwrite(FLAC__StreamEncoder *enc, FLAC__byte buffer[], size_t bytes, unsigned s
static FLAC__StreamEncoderSeekStatus
encseek(FLAC__StreamEncoder *enc, FLAC__uint64 absolute_byte_offset, void *client_data)
{
return fseeko(stdout, absolute_byte_offset, SEEK_SET) != absolute_byte_offset ?
return fseeko(stdout, absolute_byte_offset, SEEK_SET) != 0 ?
FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED :
FLAC__STREAM_ENCODER_SEEK_STATUS_OK;
}