Index: libmpc/trunk/libmpcdec/internal.h
===================================================================
--- libmpc/trunk/libmpcdec/internal.h	(revision 389)
+++ libmpc/trunk/libmpcdec/internal.h	(revision 390)
@@ -67,7 +67,7 @@
 
 typedef struct {
-	mpc_uint64_t sample;
-	mpc_uint_t tag_size;
-	char * tag;
+	mpc_uint64_t sample; /// sample where the chapter starts
+	mpc_uint_t tag_size; /// size of the tag element (0 if no tag is present for this chapter)
+	char * tag; /// pointer to an APEv2 tag without the preamble
 } mpc_chap_t;
 
@@ -93,5 +93,5 @@
 	mpc_int_t chap_nb; /// number of chapters (-1 if unknown, 0 if no chapter)
 	mpc_chap_t * chap; /// chapters position and tag
-	
+
 };
 
Index: libmpc/trunk/libmpcdec/mpc_decoder.c
===================================================================
--- libmpc/trunk/libmpcdec/mpc_decoder.c	(revision 389)
+++ libmpc/trunk/libmpcdec/mpc_decoder.c	(revision 390)
@@ -77,10 +77,4 @@
 									mpc_bool_t is_key_frame);
 static void mpc_decoder_requantisierung(mpc_decoder *d);
-
-// static void mpc_decoder_reset_y(mpc_decoder *d)
-// {
-// 	memset(d->Y_L, 0, sizeof d->Y_L);
-// 	memset(d->Y_R, 0, sizeof d->Y_R);
-// }
 
 /**
Index: libmpc/trunk/libmpcdec/mpc_demux.c
===================================================================
--- libmpc/trunk/libmpcdec/mpc_demux.c	(revision 389)
+++ libmpc/trunk/libmpcdec/mpc_demux.c	(revision 390)
@@ -50,4 +50,6 @@
 void  streaminfo_gain(mpc_streaminfo* si, const mpc_bits_reader * r_in);
 
+// mpc_decoder.c
+void mpc_decoder_reset_scf(mpc_decoder * d, int value);
 
 enum {
@@ -137,5 +139,6 @@
 
 /**
- * return the current position in the stream (in bits)
+ * return the current position in the stream (in bits) from the beginning
+ * of the file
  * @param d demuxer context
  * @return current stream position in bits
@@ -330,8 +333,13 @@
 		}
 	}
-	
+
 	d->bits_reader.buff -= size;
 }
 
+/**
+ * Gets the number of chapters in the stream
+ * @param d pointer to a musepack demuxer
+ * @return the number of chapters found in the stream
+ */
 mpc_int_t mpc_demux_chap_nb(mpc_demux * d)
 {
@@ -341,4 +349,14 @@
 }
 
+/**
+ * Gets datas associated to a given chapter
+ * You can pass 0 for tag and tag_size if you don't needs the tag information
+ * The chapter tag is an APEv2 tag without the preamble
+ * @param d pointer to a musepack demuxer
+ * @param chap_nb chapter number you want datas (from 0 to mpc_demux_chap_nb(d) - 1)
+ * @param tag will return a pointer to the chapter tag datas
+ * @param tag_size will be filed with the tag data size (0 if no tag for this chapter)
+ * @return the sample where the chapter starts
+ */
 mpc_uint64_t mpc_demux_chap(mpc_demux * d, int chap_nb, char ** tag, mpc_uint_t * tag_size)
 {
@@ -353,5 +371,5 @@
 	return d->chap[chap_nb].sample;
 }
-		
+
 static mpc_status mpc_demux_header(mpc_demux * d)
 {
Index: libmpc/trunk/libmpcdec/streaminfo.c
===================================================================
--- libmpc/trunk/libmpcdec/streaminfo.c	(revision 389)
+++ libmpc/trunk/libmpcdec/streaminfo.c	(revision 390)
@@ -126,10 +126,7 @@
 	si->block_pwr          = 0;
 
-// This is the gain reference used in old replaygain
-#define OLD_GAIN_REF 64.82
-
 	// convert gain info
 	if (si->gain_title != 0) {
-		int tmp = (int)((OLD_GAIN_REF - (mpc_int16_t)si->gain_title / 100.) * 256. + .5);
+		int tmp = (int)((MPC_OLD_GAIN_REF - (mpc_int16_t)si->gain_title / 100.) * 256. + .5);
 		if (tmp >= (1 << 16) || tmp < 0) tmp = 0;
 		si->gain_title = (mpc_int16_t) tmp;
@@ -137,5 +134,5 @@
 
 	if (si->gain_album != 0) {
-		int tmp = (int)((OLD_GAIN_REF - (mpc_int16_t)si->gain_album / 100.) * 256. + .5);
+		int tmp = (int)((MPC_OLD_GAIN_REF - (mpc_int16_t)si->gain_album / 100.) * 256. + .5);
 		if (tmp >= (1 << 16) || tmp < 0) tmp = 0;
 		si->gain_album = (mpc_int16_t) tmp;
