9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Michael Forney <mforney@mforney.org>
To: 9front@9front.org
Subject: [9front] audio/flacenc: fix error check for fseeko
Date: Thu, 11 Feb 2021 05:52:02 +0000	[thread overview]
Message-ID: <257E497C2C9B010EDAE1896C1E653CC6@arrow.hsd1.ca.comcast.net> (raw)

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).

diff 39dc377d3b0a9384a9761a5d28810e3a46b19739 da45a346b7551889d2599eb049ecaea63a2a55df
--- a/sys/src/cmd/audio/flacenc/flacenc.c	Wed Feb 10 01:00:05 2021
+++ b/sys/src/cmd/audio/flacenc/flacenc.c	Wed Feb 10 21:52:02 2021
@@ -18,7 +18,7 @@
 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;
 }

             reply	other threads:[~2021-02-11  5:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-11  5:52 Michael Forney [this message]
2021-02-11  8:40 ` Sigrid Solveig Haflínudóttir

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=257E497C2C9B010EDAE1896C1E653CC6@arrow.hsd1.ca.comcast.net \
    --to=mforney@mforney.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).