aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/mad/decoder_mad.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-05-25 19:58:57 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-05-25 19:58:57 +0000
commit5e8d2b5a9509adaae3e6a2ebc6145e45d69770db (patch)
tree56a06449ebd92e628b0484882e483c4717f93f5f /src/plugins/Input/mad/decoder_mad.cpp
parentdf5422ee06ec484c25fcc35fb9d5cd0d19b1cf66 (diff)
downloadqmmp-5e8d2b5a9509adaae3e6a2ebc6145e45d69770db.tar.gz
qmmp-5e8d2b5a9509adaae3e6a2ebc6145e45d69770db.tar.bz2
qmmp-5e8d2b5a9509adaae3e6a2ebc6145e45d69770db.zip
id3v2 support for streams
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@384 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/mad/decoder_mad.cpp')
-rw-r--r--src/plugins/Input/mad/decoder_mad.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/plugins/Input/mad/decoder_mad.cpp b/src/plugins/Input/mad/decoder_mad.cpp
index ef3b73b4e..1a58dc1c5 100644
--- a/src/plugins/Input/mad/decoder_mad.cpp
+++ b/src/plugins/Input/mad/decoder_mad.cpp
@@ -1,6 +1,7 @@
#include <QtGui>
#include "decoder_mad.h"
+#include "tagextractor.h"
#include <qmmp/constants.h>
#include <qmmp/buffer.h>
#include <qmmp/output.h>
@@ -8,7 +9,7 @@
#include <math.h>
#include <stdio.h>
-# define XING_MAGIC (('X' << 24) | ('i' << 16) | ('n' << 8) | 'g')
+# define XING_MAGIC (('X' << 24) | ('i' << 16) | ('n' << 8) | 'g')
DecoderMAD::DecoderMAD(QObject *parent, DecoderFactory *d, QIODevice *i, Output *o)
@@ -100,6 +101,14 @@ bool DecoderMAD::initialize()
}
}
+ if (input()->isSequential ()) //for streams only
+ {
+ TagExtractor extractor(input());
+ FileTag tag = extractor.id3v2tag();
+ if (!tag.isEmpty())
+ dispatch(extractor.id3v2tag());
+ }
+
mad_stream_init(&stream);
mad_frame_init(&frame);
mad_synth_init(&synth);
@@ -118,7 +127,7 @@ bool DecoderMAD::initialize()
void DecoderMAD::deinit()
{
- if(!inited)
+ if (!inited)
return;
mad_synth_finish(&synth);
@@ -232,10 +241,10 @@ bool DecoderMAD::findHeader()
if (mad_frame_decode(&frame, &stream) != -1)
done = true;
else if (!MAD_RECOVERABLE(stream.error))
- {
- qWarning("DecoderMAD: Can't decode frame");
- break;
- }
+ {
+ qWarning("DecoderMAD: Can't decode frame");
+ break;
+ }
count++;
}
@@ -344,7 +353,7 @@ void DecoderMAD::run()
mutex()->unlock();
return;
}
-
+
DecoderState::Type stat = DecoderState::Decoding;
@@ -433,7 +442,7 @@ void DecoderMAD::run()
break;
}
- if(skip_frames)
+ if (skip_frames)
{
skip_frames-- ;
mutex()->unlock();