#include <audiodecoder.h>
extern "C" {
#include "libac3/ac3.h" 
}

class AC3_Decoder : public IAudioDecoder
{
	WAVEFORMATEX m_wstr;
	ac3_frame_t* ac3_frame;
	ac3_config_t ac3_config;
	static void fillBuffer( uint_8**, uint_8** );
	static int alreadyRead;
	static uint_8* __in_data;
	static const int CHUNK_SIZE;
public:
	AC3_Decoder(const CodecInfo&, WAVEFORMATEX*);
	int GetMinSize() { return CHUNK_SIZE; }
	int Convert( unsigned char* in_data, unsigned in_size,
		     unsigned char* out_data, unsigned out_size,
		     unsigned* size_read, unsigned* size_written );
};
