Index: /dsfilters/before-you-ask.txt
===================================================================
--- /dsfilters/before-you-ask.txt	(revision 378)
+++ /dsfilters/before-you-ask.txt	(revision 379)
@@ -10,9 +10,12 @@
 
 
-Decoder and Demuxer now can play SV8 files.
-But since there is no filetype detection added
-in the registry, the process of opening a file
-may take a little while in some players.
+Decoder and Demuxer now can play SV7 and SV8 files.
+There is also filetype detection added in the registry
+so the File Source filter won't get confused and
+could detect media type easily.
 
+When opening SV7 files, the demuxer creates a seeking table
+so the file loading process can take up to 1 second with 
+common files (~ 5 minutes long).
 
 stay tuned.
Index: /dsfilters/dec_mpc/dec_mpc.rc
===================================================================
--- /dsfilters/dec_mpc/dec_mpc.rc	(revision 378)
+++ /dsfilters/dec_mpc/dec_mpc.rc	(revision 379)
@@ -61,6 +61,6 @@
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,9,0,1
- PRODUCTVERSION 0,9,0,1
+ FILEVERSION 0,9,1,2
+ PRODUCTVERSION 0,9,1,2
  FILEFLAGSMASK 0x17L
 #ifdef _DEBUG
@@ -79,10 +79,10 @@
             VALUE "Comments", "Musepack SV8 Decoder"
             VALUE "FileDescription", "mmmpcdec"
-            VALUE "FileVersion", "0, 9, 0, 1"
+            VALUE "FileVersion", "0, 9, 1, 2"
             VALUE "InternalName", "mmmpcdec"
             VALUE "LegalCopyright", "Copyright (C) 2007"
             VALUE "OriginalFilename", "mmmpcdec.ax"
             VALUE "ProductName", "MONOGRAM Musepack Decoder"
-            VALUE "ProductVersion", "0, 9, 0, 1"
+            VALUE "ProductVersion", "0, 9, 1, 2"
         END
     END
@@ -138,7 +138,7 @@
     LTEXT           "16-bit Integer",IDC_STATIC_OUTPUT,78,90,60,8
     LTEXT           "0",IDC_STATIC_FRAMES,78,114,60,8
-    CTEXT           "DirectShow filter implemented by Igor Janos",IDC_STATIC,162,90,108,16
+    CTEXT           "DirectShow filter implemented by Igor Janos",IDC_STATIC,162,96,108,16
     CTEXT           "http://blog.monogram.sk/janos",IDC_STATIC,162,120,108,8
-    CTEXT           "This software is released under the GNU LGPL licence.",IDC_STATIC,162,66,108,22
+    CTEXT           "This software is released under the GNU LGPL licence.",IDC_STATIC,162,72,108,22
     CTEXT           "http://www.musepack.net",IDC_STATIC,162,132,108,8
     LTEXT           "Replay gain:",IDC_STATIC,18,102,41,8
@@ -147,5 +147,5 @@
     LTEXT           "0.000 kbps",IDC_STATIC_BITRATE,78,126,60,8
     CTEXT           "MONOGRAM Musepack Decoder",IDC_STATIC,162,36,108,8
-    CTEXT           "0.9.0.1 alpha",IDC_STATIC,162,48,108,8
+    CTEXT           "0.9.1.2 beta",IDC_STATIC,162,48,108,8
 END
 
Index: /dsfilters/dec_mpc/dec_mpc.vcproj
===================================================================
--- /dsfilters/dec_mpc/dec_mpc.vcproj	(revision 378)
+++ /dsfilters/dec_mpc/dec_mpc.vcproj	(revision 379)
@@ -145,4 +145,5 @@
 				OutputFile=".\bin\mmmpcdec.ax"
 				LinkIncremental="1"
+				IgnoreDefaultLibraryNames=""
 				ModuleDefinitionFile="dec_mpc.def"
 				GenerateDebugInformation="false"
Index: /dsfilters/dec_mpc/src/mpc_filter.cpp
===================================================================
--- /dsfilters/dec_mpc/src/mpc_filter.cpp	(revision 378)
+++ /dsfilters/dec_mpc/src/mpc_filter.cpp	(revision 379)
@@ -294,5 +294,5 @@
 	// set the reader
 	reader.SetData(pdata, lsize);
-	reader.AppendSE();
+	if (stream_info.stream_version == 8) reader.AppendSE();
 
 	// TODO: use some more clever way of doing this.
@@ -317,10 +317,12 @@
 
 	// manually clear the buffer for demuxer
-	demux->bytes_total = reader.size; // 0
-	demux->bits_reader.buff = reader.buf; //d->buffer;
+
+	demux->bytes_total = 0; 
+	demux->bits_reader.buff = demux->buffer;
 	demux->bits_reader.count = 8;
 	demux->block_bits = 0;
 	demux->block_frames = 0;
 	demux->d->decoded_samples = 0;
+	demux->d->samples_to_skip = 0;
 
 	int	total_samples_decoded = 0;
@@ -337,4 +339,5 @@
 		mpc_status		err;
 
+		memset(&frame, 0, sizeof(frame));
 		frame.buffer = (MPC_SAMPLE_FORMAT*)samples;
 
@@ -603,4 +606,5 @@
 	ASSERT(size < 256*1024);
 	memcpy(buf, data, size);
+
 	this->size = size;
 	this->pos = 0;
Index: /dsfilters/demux_mpc/demux_mpc.rc
===================================================================
--- /dsfilters/demux_mpc/demux_mpc.rc	(revision 378)
+++ /dsfilters/demux_mpc/demux_mpc.rc	(revision 379)
@@ -61,6 +61,6 @@
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,2,0,1
- PRODUCTVERSION 0,2,0,1
+ FILEVERSION 0,3,1,2
+ PRODUCTVERSION 0,3,1,2
  FILEFLAGSMASK 0x17L
 #ifdef _DEBUG
@@ -79,10 +79,10 @@
             VALUE "Comments", "Musepack Splitter"
             VALUE "FileDescription", "mmmpcdmx"
-            VALUE "FileVersion", "0, 2, 0, 1"
+            VALUE "FileVersion", "0, 3, 1, 2"
             VALUE "InternalName", "MONOGRAM Musepack Splitter"
             VALUE "LegalCopyright", "Copyright (C) 2007"
             VALUE "OriginalFilename", "mmmpcdmx.ax"
             VALUE "ProductName", "MONOGRAM Musepack Splitter"
-            VALUE "ProductVersion", "0, 2, 0, 1"
+            VALUE "ProductVersion", "0, 3, 1, 2"
         END
     END
@@ -133,5 +133,5 @@
     CONTROL         101,IDC_STATIC,"Static",SS_BITMAP,0,0,280,30
     CTEXT           "MONOGRAM Musepack Splitter",IDC_STATIC,162,36,108,8
-    CTEXT           "0.2.0.1 alpha",IDC_STATIC,162,48,108,8
+    CTEXT           "0.3.1.2 beta",IDC_STATIC,162,48,108,8
 END
 
Index: /dsfilters/demux_mpc/src/bits.h
===================================================================
--- /dsfilters/demux_mpc/src/bits.h	(revision 378)
+++ /dsfilters/demux_mpc/src/bits.h	(revision 379)
@@ -117,3 +117,28 @@
 		bitbuf = (tmp[0] << 24) | (tmp[1] << 16) | (tmp[2] << 8) | (tmp[3]);
 	}
+
+	inline void PutBits(int32 val, int32 num) {
+		bits += num;
+		if (num < 32) val &= (1<<num)-1;
+		if (bits > 32) {
+			bits -= 32;
+			bitbuf |= val >> (bits);
+			*buf++ = ( bitbuf >> 24 ) & 0xff;
+			*buf++ = ( bitbuf >> 16 ) & 0xff;
+			*buf++ = ( bitbuf >>  8 ) & 0xff;
+			*buf++ = ( bitbuf >>  0 ) & 0xff;
+			bitbuf = val << (32 - bits);
+		} else
+		bitbuf |= val << (32 - bits);
+	}
+	inline void WriteBits()	{ 
+		while (bits >= 8) { 
+			*buf++ = (bitbuf >> 24) & 0xff;	
+			bitbuf <<= 8;
+			bits -= 8; 
+		} 
+	}
+	inline void Put_ByteAlign_Zero() { int32 bl=(bits)&0x07; if (bl<8) { PutBits(0,8-bl); } WriteBits(); }
+	inline void Put_ByteAlign_One() { int32 bl=(bits)&0x07; if (bl<8) {	PutBits(0xffffff,8-bl); } WriteBits(); }
+
 };
Index: /dsfilters/demux_mpc/src/mpc_file.cpp
===================================================================
--- /dsfilters/demux_mpc/src/mpc_file.cpp	(revision 378)
+++ /dsfilters/demux_mpc/src/mpc_file.cpp	(revision 379)
@@ -7,5 +7,5 @@
 //-----------------------------------------------------------------------------
 #include "stdafx.h"
-
+#include <math.h>
 
 
@@ -25,4 +25,10 @@
 	extradata_size = 0;
 	extradata = (uint8*)malloc(extradata_max_size);
+	bits_to_skip = 0;
+
+	gain_album_db = 0;
+	gain_album_peak_db = 0;
+	gain_title_db = 0;
+	gain_title_peak_db = 0;
 }
 
@@ -93,5 +99,5 @@
 		reader->GetPosition(&first_ap_pos, &avail);
 
-		reader->Seek(seek_table_position);
+		reader->Seek(seek_table_position/8);
 		ret = packet.Load(reader);
 		ret = ReadSeekTable(&packet); 
@@ -126,14 +132,18 @@
 
 	uint8		hdr[8*4];
+	
+	__int64 c, a;
+	reader->GetPosition(&c, &a);
 	ret = reader->Read(extradata + 4, 6*4);
 	if (ret < 0) return -1;			// not enough data
-	memcpy(hdr, extradata+4, 5*4);
 	extradata_size += 6*4;
+	reader->Seek(c);
+	ret = reader->ReadSwapped(hdr, 6*4);
 	Bitstream	b(hdr);
 
-	b.NeedBits32_MPC();
-	audio_block_frames = (b.UGetBits(16)<<16) | b.UGetBits(16);
-
-	b.NeedBits32_MPC();
+	b.NeedBits32();
+	int audio_frames = (b.UGetBits(16)<<16) | b.UGetBits(16);
+
+	b.NeedBits32();
 	b.UGetBits(1);				// intensity stereo, should be 0
 	b.UGetBits(1);				// mid-side
@@ -153,18 +163,35 @@
 	b.UGetBits(16);				// max-level
 
-	b.NeedBits32_MPC();
-	gain_title_db = b.SGetBits(16) / 100.0;				// title gain
-	gain_title_peak_db = b.UGetBits(16);		// title peak
-
-	b.NeedBits32_MPC();
-	gain_album_db = b.SGetBits(16) / 100.0;				// album gain
-	gain_album_peak_db = b.UGetBits(16);		// album peak
-
-
-
-	b.NeedBits32_MPC();
+	b.NeedBits32();
+	gain_title_db = b.SGetBits(16) / 100.0;		// title gain
+	int title_peak = b.UGetBits(16);
+	if (title_peak != 0) {
+		gain_title_peak_db = 20 * log10f((float)title_peak);		// title peak
+	} else {
+		gain_title_peak_db = 0;
+	}
+
+	b.NeedBits32();
+	gain_album_db = b.SGetBits(16) / 100.0;		// album gain
+	int album_peak = b.UGetBits(16);
+	if (album_peak != 0) {
+		gain_album_peak_db = 20 * log10f((float)album_peak);		// album peak
+	} else {
+		gain_album_peak_db = 0;
+	}
+
+	#define OLD_GAIN_REF		64.82
+	if (gain_title_db != 0) {
+		gain_title_db = OLD_GAIN_REF - gain_title_db;
+	}
+	if (gain_album_db != 0) {
+		gain_album_db = OLD_GAIN_REF - gain_album_db;
+	}
+
+	b.NeedBits32();
 	true_gapless = b.UGetBits(1);			// true gapless
 	int last_frame = b.UGetBits(11);		// last-frame samples
-	total_samples = (audio_block_frames * 1152);
+	audio_block_frames = 1;
+	total_samples = (audio_frames * 1152);
 	if (true_gapless) {
 		total_samples -= (1152 - last_frame);
@@ -178,5 +205,5 @@
 	b.UGetBits(3);
 
-	b.NeedBits32_MPC();
+	b.NeedBits32();
 	int ver = b.UGetBits(8);
 
@@ -192,14 +219,37 @@
 
 	// alloc memory for seek table
-	seek_table = (uint32*)malloc(tmp * sizeof(uint32));
+	seek_table = (uint64*)malloc(tmp * sizeof(uint64));
 	if (!seek_table) return -1;
 
 	int64 pos, av;
 	reader->GetPosition(&pos, &av);
-	seek_table[0] = pos*8;		// current position in bits
+	seek_table[0] = pos*8 - b.BitsLeft();		// current position in bits
 	seek_table_size = 1;
 
-	// TODO: loop through file to get complete seeking table
-
+	// loop through file to get complete seeking table
+	CMPCPacket	packet;
+	int64 seek_frames = 0;
+	Seek(0);
+	do {
+		if (seek_frames*1152 >= total_samples) break;
+
+		// new entry in seeking table
+		if (seek_frames == (seek_table_size << seek_pwr)) {
+			__int64 c, a;
+			reader->GetPosition(&c, &a);
+			seek_table[seek_table_size] = (c*8) + bits_to_skip;
+			seek_table_size++;
+		}
+
+		ret = packet.Load_SV7(reader, bits_to_skip, true);
+		if (ret<0) break;
+		seek_frames += 1;
+	} while (true);
+
+	// seek to begin
+	Seek(0);
+
+	header_position = 0;
+	bits_to_skip = 0;
 	return 0;
 }
@@ -261,5 +311,5 @@
 	Bitstream	b(packet->payload);
 
-	seek_table_position = b.GetMpcSize();
+	seek_table_position = b.GetMpcSize() * 8;
 	seek_table_position += packet->file_position;
 
@@ -280,14 +330,14 @@
 
 	// alloc memory for seek table
-	seek_table = (uint32*)malloc(tmp * sizeof(uint32));
-
-	uint32 *table = seek_table;
+	seek_table = (uint64*)malloc(tmp * sizeof(uint64));
+
+	uint64 *table = seek_table;
 
 	tmp = b.GetMpcSize();
-	table[0] = (uint32)(tmp + header_position) * 8;
+	table[0] = (uint32)(tmp*8 + header_position);
 	if (seek_table_size == 1) return 0;
 
 	tmp = b.GetMpcSize();
-	table[1] = (uint32)(tmp + header_position) * 8;
+	table[1] = (uint64)(tmp*8 + header_position);
 	for (int i=2; i<seek_table_size; i++) {
 		int code = b.Get_Golomb(12);
@@ -316,17 +366,4 @@
 
 	switch (stream_version) {
-	case 7:
-		{
-			//-----------------------------------------------------------------
-			//	Stream Version 7
-			//-----------------------------------------------------------------
-
-			// since we don't do any actual decoding here, we can only look 
-			// for the fields of our interest
-
-			// TODO: later. now we want SV8
-
-		}
-		break;
 	case 8:
 		{
@@ -361,5 +398,5 @@
 
 			// store absolute position of stream header
-			header_position = packet->file_position -4;
+			header_position = packet->file_position - 4*8;
 		}
 		break;
@@ -379,24 +416,35 @@
 	int ret;
 
+	// end of file ?
+	if (current_sample >= total_samples) return -2;
+
 	do {
-		ret = packet->Load(reader);
+		switch (stream_version) {
+		case 7:	ret = packet->Load_SV7(reader, bits_to_skip); break;
+		case 8: ret = packet->Load(reader); break;
+		default: ret = -2; break;
+		}
 		if (ret < 0) {
 			return ret;
 		}
 
-		switch (packet->key) {
-		case MPC_KEY('A','P'):	
-			{
-				// keep track of samples...
-				if (cur_sample) *cur_sample = current_sample;
-				current_sample += (1152*audio_block_frames);
-
-				return 0;			// we got one
+		// keep track of samples...
+		if (cur_sample) *cur_sample = current_sample;
+		if (stream_version == 8) {
+			switch (packet->key) {
+			case MPC_KEY('A','P'):	
+				{
+					current_sample += (1152*audio_block_frames);
+					return 0;			// we got one
+				}
+			case MPC_KEY('S','E'):
+				{
+					return -2;
+				}
+				break;
 			}
-		case MPC_KEY('S','E'):
-			{
-				return -2;
-			}
-			break;
+		} else {
+			current_sample += (1152*audio_block_frames);
+			return 0;
 		}
 
@@ -438,7 +486,6 @@
 
 	// seek to position
-	uint32 pos = seek_table[i] >> 3;
-	CString f;
-	f.Format(_T("CMPCFile::Seek : %d"), pos);
+	uint64 pos = seek_table[i] >> 3;
+	bits_to_skip = seek_table[i] & 0x07;
 	reader->Seek(pos);
 
@@ -483,4 +530,85 @@
 }
 
+int CMPCPacket::Load_SV7(CMPCReader *reader, int &bits_to_skip, bool only_parse)
+{
+	uint8	temp[14*1024];
+	uint8	outtemp[14*1024];
+	__int64	cur, av;
+	int		t;
+	int		total_bits;
+
+	Release();
+
+	reader->GetPosition(&cur, &av);
+	int ret = reader->ReadSwapped(temp, min(sizeof(temp), (av-cur)));
+	if (ret < 0) return 0;
+
+	Bitstream	b(temp);
+	Bitstream	o(outtemp);
+	b.NeedBits32();
+
+	// We load bits from input file and store it into our buffer.
+	// There they will always start at byte alignment so they can 
+	// be transferred to decoder in a pleasant way.
+
+	// skip bits from previous frame
+	if (bits_to_skip > 0) {	b.DumpBits(bits_to_skip); }
+	file_position = (cur*8) + bits_to_skip;
+
+	// 20-bit frame length
+	b.NeedBits24();
+	int	frame_len_bits = b.UGetBits(20);
+	o.PutBits(frame_len_bits, 20);
+
+	if (only_parse == false) {
+		// load data
+		int left_bits = frame_len_bits;
+		while (left_bits > 16) {
+			b.NeedBits();
+			t = b.UGetBits(16);
+			o.PutBits(t, 16);
+			left_bits -= 16;
+		}
+		b.NeedBits();
+		t = b.UGetBits(left_bits);
+		o.PutBits(t, left_bits);
+
+		// zero-align 32-bit word
+		total_bits = (20 + frame_len_bits + 31) &~ 31;
+		int zero_bits = total_bits - frame_len_bits;
+		o.PutBits(0, zero_bits);
+		o.WriteBits();
+	}
+
+	// bits to skip in the next frame
+	__int64 finalpos = file_position + 20 + frame_len_bits;
+	bits_to_skip = (finalpos & 7);
+	reader->Seek(finalpos >> 3);
+
+	// copy data
+	if (only_parse == false) {
+		packet_size  = total_bits >> 3;
+		payload_size = packet_size;
+		packet = (uint8*)malloc(packet_size);
+		payload = packet;				// pointer to packet payload
+
+		// copy data
+		uint8 *src = outtemp;
+		uint8 *dst = packet;
+		int left = packet_size;
+		while (left > 3) {
+			dst[0] = src[3];
+			dst[1] = src[2];
+			dst[2] = src[1];
+			dst[3] = src[0];
+			src += 4;
+			dst += 4;
+			left-= 4;
+		}
+	}
+
+	return 0;
+}
+
 int CMPCPacket::Load(CMPCReader *reader)
 {
@@ -493,21 +621,15 @@
 
 	// end of stream
-	if (file_position >= avail) {
-		return -2;
-	}
+	if (file_position >= avail) return -2;
+	file_position *= 8;
 
 	ret = reader->GetKey(key_val);					
-	if (ret < 0) {
-		return ret;
-	}
+	if (ret < 0) return ret;
+
 	ret = reader->GetSizeElm(size_val, size_len);	
-	if (ret < 0) {
-		return ret;
-	}
+	if (ret < 0) return ret;
 
 	// if the key is not valid, quit
-	if (!reader->KeyValid(key_val)) {
-		return -1;
-	}
+	if (!reader->KeyValid(key_val)) return -1;
 	key = key_val;
 
@@ -519,12 +641,9 @@
 
 	// roll back the bytes
-	reader->Seek(file_position);
+	reader->Seek(file_position/8);
 	ret = reader->Read(packet, packet_size);		
-	if (ret < 0) {
-		return ret;
-	}
-
-	return 0;
-}
-
-
+	if (ret < 0) return ret;
+	return 0;
+}
+
+
Index: /dsfilters/demux_mpc/src/mpc_file.h
===================================================================
--- /dsfilters/demux_mpc/src/mpc_file.h	(revision 378)
+++ /dsfilters/demux_mpc/src/mpc_file.h	(revision 379)
@@ -19,5 +19,5 @@
 {
 public:
-	int64		file_position;				// absolute file position
+	int64		file_position;				// absolute file position (in bits)
 
 	uint8		*packet;					// we own this one
@@ -35,4 +35,5 @@
 
 	// loading packets
+	int Load_SV7(CMPCReader *reader, int &bits_to_skip, bool only_parse=false);
 	int Load(CMPCReader *reader);
 	void Release();
@@ -69,7 +70,7 @@
 
 	// seeking table
-	int64			seek_table_position;		// position of seeking table in file
-	int64			header_position;
-	uint32			*seek_table;
+	int64			seek_table_position;		// position of seeking table in file (in bits)
+	int64			header_position;			// (in bits)
+	uint64			*seek_table;
 	int64			seek_table_size;
 
@@ -80,4 +81,5 @@
 	// internals
 	CMPCReader		*reader;				// file reader interface
+	int				bits_to_skip;			// after seeking
 
 	// buffer for decoder specific info
Index: /dsfilters/demux_mpc/src/mpc_filter.cpp
===================================================================
--- /dsfilters/demux_mpc/src/mpc_filter.cpp	(revision 378)
+++ /dsfilters/demux_mpc/src/mpc_filter.cpp	(revision 379)
@@ -267,11 +267,7 @@
 		if (FAILED(hr)) return hr;
 
-		// destroy input file
+		// destroy input file, reader and update property page
 		if (file) { delete file; file = NULL; }
-
-		// destroy reader
 		if (reader) { delete reader; reader = NULL;	}
-
-		// refresh property page if there is any
 		if (IsWindow(wnd_prop)) {
 			PostMessage(wnd_prop, WM_UPDATE_VISUALS, 0, 0);
@@ -307,5 +303,8 @@
 	info->sample_rate = file->sample_rate;
 	info->block_frames = file->audio_block_frames;
-
+	info->gain_album_db = file->gain_album_db;
+	info->gain_album_peak_db = file->gain_album_peak_db;
+	info->gain_title_db = file->gain_title_db;
+	info->gain_title_peak_db = file->gain_title_peak_db;
 	return NOERROR;
 }
Index: /dsfilters/demux_mpc/src/mpc_pin.cpp
===================================================================
--- /dsfilters/demux_mpc/src/mpc_pin.cpp	(revision 378)
+++ /dsfilters/demux_mpc/src/mpc_pin.cpp	(revision 379)
@@ -638,4 +638,45 @@
 }
 
+int CMPCReader::ReadSwapped(void *buf, int size)
+{
+	// this method should only be used to read smaller chunks of data - 
+	// one maximum MPC SV7 frame
+	uint8	temp[16*1024];
+
+	// 32-bit aligned words
+	__int64 cur, av;
+	GetPosition(&cur, &av);
+
+	int preroll = cur & 0x03;
+	__int64	aligned_pos = cur - preroll;
+	int read_size = ((size + preroll) + 0x03) &~ 0x03;		// alignment
+
+	// read the data
+	Seek(aligned_pos);
+	int ret = Read(temp, read_size);
+	if (ret < 0) return ret;
+
+	// swap bytes
+	uint8 *bcur = temp;
+#define SWAP(a,b)	do { uint8 t=(a); (a)=(b); (b)=t; } while (0)
+	while (read_size > 3) {
+		SWAP(bcur[0], bcur[3]);
+		SWAP(bcur[1], bcur[2]);
+		bcur += 4;
+		read_size -= 4;
+	}
+#undef SWAP
+
+	// copy data
+	bcur = temp + preroll;
+	memcpy(buf, bcur, size);
+
+	// advance
+	Seek(cur + size);
+
+	return 0;
+}
+
+
 // reading syntax elements
 int CMPCReader::GetMagick(uint32 &elm)
Index: /dsfilters/demux_mpc/src/mpc_pin.h
===================================================================
--- /dsfilters/demux_mpc/src/mpc_pin.h	(revision 378)
+++ /dsfilters/demux_mpc/src/mpc_pin.h	(revision 379)
@@ -201,4 +201,5 @@
 	virtual int Seek(__int64 pos);
 	virtual int Read(void *buf, int size);
+	virtual int ReadSwapped(void *buf, int size);
 
 	void BeginFlush() { if (reader) reader->BeginFlush(); }
Index: /dsfilters/demux_mpc/src/mpc_prop.cpp
===================================================================
--- /dsfilters/demux_mpc/src/mpc_prop.cpp	(revision 378)
+++ /dsfilters/demux_mpc/src/mpc_prop.cpp	(revision 379)
@@ -139,13 +139,33 @@
 	ListView_SetItemText(ITEM(IDC_LIST_CONTENT), item, 1, val.GetBuffer());
 
+	// Gains
+	i.pszText = _T("Album gain");	i.iItem = 4;
+	val.Format(_T("%3.2f dB"), info.gain_album_db);
+	item = ListView_InsertItem(ITEM(IDC_LIST_CONTENT), &i);
+	ListView_SetItemText(ITEM(IDC_LIST_CONTENT), item, 1, val.GetBuffer());
+
+	i.pszText = _T("Album peak");	i.iItem = 5;
+	val.Format(_T("%3.2f dB"), info.gain_album_peak_db);
+	item = ListView_InsertItem(ITEM(IDC_LIST_CONTENT), &i);
+	ListView_SetItemText(ITEM(IDC_LIST_CONTENT), item, 1, val.GetBuffer());
+
+	i.pszText = _T("Title gain");	i.iItem = 6;
+	val.Format(_T("%3.2f dB"), info.gain_title_db);
+	item = ListView_InsertItem(ITEM(IDC_LIST_CONTENT), &i);
+	ListView_SetItemText(ITEM(IDC_LIST_CONTENT), item, 1, val.GetBuffer());
+
+	i.pszText = _T("Title peak");	i.iItem = 7;
+	val.Format(_T("%3.2f dB"), info.gain_title_peak_db);
+	item = ListView_InsertItem(ITEM(IDC_LIST_CONTENT), &i);
+	ListView_SetItemText(ITEM(IDC_LIST_CONTENT), item, 1, val.GetBuffer());
+
 	if (info.stream_version == 8) {
-
-		// Channels
-		i.pszText = _T("Frames per packet");	i.iItem = 4;
+		// Frames per packet
+		i.pszText = _T("Frames per packet");	i.iItem = 8;
 		val.Format(_T("%d"), info.block_frames);
 		item = ListView_InsertItem(ITEM(IDC_LIST_CONTENT), &i);
 		ListView_SetItemText(ITEM(IDC_LIST_CONTENT), item, 1, val.GetBuffer());
+	}
 
-	}
 }
 
Index: /dsfilters/demux_mpc/src/mpc_reg.cpp
===================================================================
--- /dsfilters/demux_mpc/src/mpc_reg.cpp	(revision 378)
+++ /dsfilters/demux_mpc/src/mpc_reg.cpp	(revision 379)
@@ -105,4 +105,5 @@
 	// write the string
 	r.SetStringValue(_T("0"), _T("0,4,,4D50434B"));											// MPCK
+	r.SetStringValue(_T("1"), _T("0,3,,4D502B"));											// MP+
 	r.SetStringValue(_T("Source Filter"), _T("{E436EBB5-524F-11CE-9F53-0020AF0BA770}"));	// file source async
 	r.Close();
Index: /dsfilters/demux_mpc/src/mpc_types.h
===================================================================
--- /dsfilters/demux_mpc/src/mpc_types.h	(revision 378)
+++ /dsfilters/demux_mpc/src/mpc_types.h	(revision 379)
@@ -55,4 +55,9 @@
 	int		channels;
 	int		block_frames;			// frames per audio packet
+
+	float	gain_album_db;
+	float	gain_album_peak_db;
+	float	gain_title_db;
+	float	gain_title_peak_db;
 };
 
