use the sample number for the granulepos
authorJosh Coalson <jcoalson@users.sourceforce.net>
Wed, 6 Feb 2002 07:33:49 +0000 (07:33 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Wed, 6 Feb 2002 07:33:49 +0000 (07:33 +0000)
src/flac/encode.c

index 28f694b..de0d8d0 100644 (file)
@@ -1018,6 +1018,7 @@ FLAC__StreamEncoderWriteStatus write_callback(const FLAC__StreamEncoder *encoder
 
                memset(&op, 0, sizeof(op));
                op.packet = (unsigned char *)buffer;
+               op.granulepos = encoder_wrapper->bytes_written - 1;
                op.packetno = encoder_wrapper->current_frame;
                op.bytes = bytes;