aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/mad/decoder_mad.h
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2017-02-25 13:08:53 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2017-02-25 13:08:53 +0000
commit6bb25ee7ef5962dd599a6f27e466bb0eea83c207 (patch)
treeddb38b145bab38f8e777383a7f94f5b048580044 /src/plugins/Input/mad/decoder_mad.h
parent53ac1b9923438a7b53e5a27c28cf48bb2b91af5d (diff)
downloadqmmp-6bb25ee7ef5962dd599a6f27e466bb0eea83c207.tar.gz
qmmp-6bb25ee7ef5962dd599a6f27e466bb0eea83c207.tar.bz2
qmmp-6bb25ee7ef5962dd599a6f27e466bb0eea83c207.zip
mad: added lame header support (#138)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@7054 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/mad/decoder_mad.h')
-rw-r--r--src/plugins/Input/mad/decoder_mad.h34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/plugins/Input/mad/decoder_mad.h b/src/plugins/Input/mad/decoder_mad.h
index d74754a38..c1dcd84c9 100644
--- a/src/plugins/Input/mad/decoder_mad.h
+++ b/src/plugins/Input/mad/decoder_mad.h
@@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2001 Brad Hughes <bhughes@trolltech.com> *
* Copyright (C) 2000-2004 Robert Leslie <rob@mars.org> *
- * Copyright (C) 2009-2012 Ilya Kotov forkotov02@hotmail.ru *
+ * Copyright (C) 2009-2017 Ilya Kotov forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -49,13 +49,24 @@ public:
void seek(qint64);
private:
+ //LAME header
+ struct LameHeader
+ {
+ unsigned char revision;
+ unsigned char flags;
+ mad_fixed_t peak;
+ unsigned short start_delay;
+ unsigned short end_padding;
+ qint8 gain;
+ };
// helper functions
bool decodeFrame();
qint64 madOutputFloat(float *data, qint64 samples);
bool fillBuffer();
void deinit();
bool findHeader();
- bool findXingHeader(struct mad_bitptr, unsigned int);
+ bool findXingHeader(struct mad_bitptr, unsigned int bitlen);
+ LameHeader *findLameHeader(struct mad_bitptr ptr, unsigned int bitlen);
uint findID3v2(uchar *data, ulong size);
bool m_inited, m_eof;
qint64 m_totalTime;
@@ -68,14 +79,27 @@ private:
qint64 m_input_bytes;
// MAD decoder
- struct
+
+ //xing header
+ struct XingHeader
{
int flags;
unsigned long frames;
unsigned long bytes;
unsigned char toc[100];
long scale;
- } xing;
+ LameHeader *lame;
+
+ XingHeader()
+ {
+ flags = 0;
+ frames = 0;
+ bytes = 0;
+ scale = 0;
+ lame = 0;
+ }
+ };
+ XingHeader m_xing;
enum
{
@@ -88,6 +112,8 @@ private:
struct mad_stream m_stream;
struct mad_frame m_frame;
struct mad_synth m_synth;
+ qint64 m_skip_bytes, m_play_bytes;
+
};