From 5fd4fa912ef622333b38268786ff4609c81f2ec9 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 11 Feb 2021 09:37:36 +0100 Subject: [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). --- sys/src/cmd/audio/flacenc/flacenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/src/cmd/audio/flacenc/flacenc.c b/sys/src/cmd/audio/flacenc/flacenc.c index c19c84621..773d11de3 100644 --- a/sys/src/cmd/audio/flacenc/flacenc.c +++ b/sys/src/cmd/audio/flacenc/flacenc.c @@ -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; } -- cgit v1.2.3