Index: libmpc/branches/r2d/libmpcenc/encode_sv7.c
===================================================================
--- libmpc/branches/r2d/libmpcenc/encode_sv7.c	(revision 204)
+++ libmpc/branches/r2d/libmpcenc/encode_sv7.c	(revision 212)
@@ -60,11 +60,15 @@
 
 // writes replay gain info
-static void writeGainInfo ( mpc_encoder_t * e )
+static void writeGainInfo ( mpc_encoder_t * e,
+							unsigned short t_gain,
+							unsigned short t_peak,
+							unsigned short a_gain,
+							unsigned short a_peak)
 {
 	writeBits ( e, 1,  8 ); // version
-	writeBits ( e, 0,  16 ); // Title gain
-	writeBits ( e, 0,  16 ); // Title peak
-	writeBits ( e, 0,  16 ); // Album gain
-	writeBits ( e, 0,  16 ); // Album peak
+	writeBits ( e, t_gain,  16 ); // Title gain
+	writeBits ( e, t_peak,  16 ); // Title peak
+	writeBits ( e, a_gain,  16 ); // Album gain
+	writeBits ( e, a_peak,  16 ); // Album peak
 }
 
@@ -76,5 +80,9 @@
                   const unsigned int  SamplesCount,
                   const unsigned int  SampleFreq,
-				  const unsigned int  ChannelCount)
+				  const unsigned int  ChannelCount,
+				  unsigned short t_gain,
+				  unsigned short t_peak,
+				  unsigned short a_gain,
+				  unsigned short a_peak)
 {
 	unsigned char tmp[10];
@@ -104,5 +112,5 @@
 	writeBits ( e, FRAMES_PER_BLOCK_PWR >> 1,  3 );    // frames per block (log4 unit)
 
-	writeGainInfo(e);
+	writeGainInfo(e, t_gain, t_peak, a_gain, a_peak);
 }
 
Index: libmpc/branches/r2d/libmpcenc/libmpcenc.h
===================================================================
--- libmpc/branches/r2d/libmpcenc/libmpcenc.h	(revision 204)
+++ libmpc/branches/r2d/libmpcenc/libmpcenc.h	(revision 212)
@@ -80,5 +80,9 @@
 						const unsigned int  SamplesCount,
 						const unsigned int  SampleFreq,
-						const unsigned int  ChannelCount);
+						const unsigned int  ChannelCount,
+						unsigned short t_gain,
+						unsigned short t_peak,
+						unsigned short a_gain,
+						unsigned short a_peak);
  void writeEncoderInfo ( mpc_encoder_t * e,
 						 const float profile,
