--- src/libFLAC/stream_encoder.c	(.../vendor/flac/1.2.1)	(revision 482)
+++ src/libFLAC/stream_encoder.c	(.../trunk/lib/flac)	(revision 482)
@@ -1398,6 +1398,28 @@
 #endif
 }
 
+FLAC_API FLAC__bool FLAC__stream_encoder_flush(FLAC__StreamEncoder *encoder) {
+	FLAC__bool error = false;
+    FLAC__uint64 offset;
+
+	if(!encoder->private_->tell_callback 
+            || encoder->private_->tell_callback(encoder, &offset, encoder->private_->client_data) == FLAC__STREAM_ENCODER_TELL_STATUS_ERROR) {
+        return false;
+    }
+
+    update_metadata_(encoder);
+
+    /* check if an error occurred while updating metadata */
+    if(encoder->protected_->state != FLAC__STREAM_ENCODER_OK)
+        error = true;
+   
+    if(!encoder->private_->seek_callback 
+            || encoder->private_->seek_callback(encoder, offset, encoder->private_->client_data) != FLAC__STREAM_ENCODER_SEEK_STATUS_OK)
+        error = true;
+
+    return !error;
+}
+
 FLAC_API FLAC__bool FLAC__stream_encoder_set_verify(FLAC__StreamEncoder *encoder, FLAC__bool value)
 {
 	FLAC__ASSERT(0 != encoder);
--- include/FLAC/stream_encoder.h	(.../vendor/flac/1.2.1)	(revision 482)
+++ include/FLAC/stream_encoder.h	(.../trunk/lib/flac)	(revision 482)
@@ -1700,6 +1700,8 @@
  */
 FLAC_API FLAC__bool FLAC__stream_encoder_finish(FLAC__StreamEncoder *encoder);
 
+FLAC_API FLAC__bool FLAC__stream_encoder_flush(FLAC__StreamEncoder *encoder);
+
 /** Submit data for encoding.
  *  This version allows you to supply the input data via an array of
  *  pointers, each pointer pointing to an array of \a samples samples
