use -1 for the granulepos in the metadata packet

This commit is contained in:
Josh Coalson
2002-02-06 19:26:14 +00:00
parent 6188feb8bb
commit 39bc0c2743

View File

@@ -1022,11 +1022,9 @@ FLAC__StreamEncoderWriteStatus write_callback(const FLAC__StreamEncoder *encoder
/*@@@ WATCHOUT:
* this depends on the behavior of libFLAC that we will get one
* write_callback first with all the metadata (and 'samples'
* will be 0), then one for each frame, hence the +1 so that the
* metadata packet is packet 0, the first audio frame is 1, and
* so on.
* will be 0), then one write_callback for each frame.
*/
op.packetno = (samples == 0? 0 : encoder_wrapper->current_frame + 1);
op.packetno = (samples == 0? -1 : (int)encoder_wrapper->current_frame);
op.bytes = bytes;
if (encoder_wrapper->bytes_written == bytes)