aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/aac/decoderaacfactory.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2012-02-29 16:58:18 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2012-02-29 16:58:18 +0000
commit9cc257c8e4f6ab239c10b935b088b56c174c881a (patch)
tree861a59cfcc1bd3487004f5e0088d3791c3a47a8b /src/plugins/Input/aac/decoderaacfactory.cpp
parent7988d3534cddf21eba4005b7638b79325e23b2d1 (diff)
downloadqmmp-9cc257c8e4f6ab239c10b935b088b56c174c881a.tar.gz
qmmp-9cc257c8e4f6ab239c10b935b088b56c174c881a.tar.bz2
qmmp-9cc257c8e4f6ab239c10b935b088b56c174c881a.zip
aac decoder: fixed streams support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2652 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/aac/decoderaacfactory.cpp')
-rw-r--r--src/plugins/Input/aac/decoderaacfactory.cpp26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/plugins/Input/aac/decoderaacfactory.cpp b/src/plugins/Input/aac/decoderaacfactory.cpp
index ebf48b6d1..6a11ba082 100644
--- a/src/plugins/Input/aac/decoderaacfactory.cpp
+++ b/src/plugins/Input/aac/decoderaacfactory.cpp
@@ -36,28 +36,8 @@ bool DecoderAACFactory::supports(const QString &source) const
bool DecoderAACFactory::canDecode(QIODevice *input) const
{
- uchar buf[4096];
- qint64 buf_at = input->peek((char *) buf, 4096);
-
- int tag_size = 0;
- if (!memcmp(buf, "ID3", 3)) //skip ID3 tag
- {
- /* high bit is not used */
- tag_size = (buf[6] << 21) | (buf[7] << 14) |
- (buf[8] << 7) | (buf[9] << 0);
-
- tag_size += 10;
- if (buf_at - tag_size < 4)
- return false;
-
- memmove (buf, buf + tag_size, buf_at - tag_size);
- }
- //try to determinate header type;
- if (buf[0] == 0xff && ((buf[1] & 0xf6) == 0xf0)) //ADTS header
- return true;
- else if (!memcmp(buf, "ADIF", 4)) //ADIF header
- return true;
- return false;
+ AACFile aac_file(input, false, false);
+ return aac_file.isValid();
}
const DecoderProperties DecoderAACFactory::properties() const
@@ -66,7 +46,7 @@ const DecoderProperties DecoderAACFactory::properties() const
properties.name = tr("AAC Plugin");
properties.filters << "*.aac";
properties.description = tr("AAC Files");
- //properties.contentType = ;
+ properties.contentTypes << "audio/aacp";
properties.shortName = "aac";
properties.hasAbout = true;
properties.hasSettings = false;