diff options
author | Max Linke <kain88@mixxx.org> | 2014-04-29 19:15:47 +0200 |
---|---|---|
committer | Max Linke <kain88@mixxx.org> | 2014-04-29 19:15:47 +0200 |
commit | ad097a849bc670b226a965e067b4aba53750cf54 (patch) | |
tree | 016af3ed736be23e5561d7213e95c774359e5a43 /plugins | |
parent | f4ce8f1b0cf2108be4edb0cc9faba86bb5846cb0 (diff) |
update m4a plugin to math refactor
also cleaned up some withspace fixes
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/soundsourcem4a/m4a/mp4-mixxx.cpp | 6 | ||||
-rw-r--r-- | plugins/soundsourcem4a/soundsourcem4a.cpp | 4 | ||||
-rw-r--r-- | plugins/soundsourcem4a/soundsourcem4a.h | 9 |
3 files changed, 10 insertions, 9 deletions
diff --git a/plugins/soundsourcem4a/m4a/mp4-mixxx.cpp b/plugins/soundsourcem4a/m4a/mp4-mixxx.cpp index 4d7de3d05a..4d226947ca 100644 --- a/plugins/soundsourcem4a/m4a/mp4-mixxx.cpp +++ b/plugins/soundsourcem4a/m4a/mp4-mixxx.cpp @@ -9,7 +9,7 @@ #include <QtCore> #include <stdlib.h> -#include "mathstuff.h" +#include "util/math.h" /* * Copyright 2006 dnk <dnk@bjum.net> @@ -429,8 +429,8 @@ static int mp4_seek_sample(struct input_plugin_data *ip_data, int sample) // pops). This is akin to seeking in a video and seeing MPEG // artifacts. Figure out how many frames we need to go backward -- 1 seems // to work. - const int how_many_backwards = 1; - int start_frame = math_max(frame_for_sample - how_many_backwards, 1); + const unsigned int how_many_backwards = 1; + int start_frame = math_max(frame_for_sample - how_many_backwards, 1U); priv->mp4.sample = start_frame; // rryan 9/2009 -- the documentation is sketchy on this, but I think that diff --git a/plugins/soundsourcem4a/soundsourcem4a.cpp b/plugins/soundsourcem4a/soundsourcem4a.cpp index 0fa58c3264..9e3717ddde 100644 --- a/plugins/soundsourcem4a/soundsourcem4a.cpp +++ b/plugins/soundsourcem4a/soundsourcem4a.cpp @@ -55,7 +55,7 @@ SoundSourceM4A::~SoundSourceM4A() { } } -int SoundSourceM4A::open() +Result SoundSourceM4A::open() { //Initialize the FAAD2 decoder... initializeDecoder(); @@ -175,7 +175,7 @@ inline long unsigned SoundSourceM4A::length(){ //return m_iChannels * mp4_duration(&ipd) * m_iSampleRate; } -int SoundSourceM4A::parseHeader(){ +Result SoundSourceM4A::parseHeader(){ setType("m4a"); TagLib::MP4::File f(getFilename().toLocal8Bit().constData()); diff --git a/plugins/soundsourcem4a/soundsourcem4a.h b/plugins/soundsourcem4a/soundsourcem4a.h index c800c713b5..f039c5f25f 100644 --- a/plugins/soundsourcem4a/soundsourcem4a.h +++ b/plugins/soundsourcem4a/soundsourcem4a.h @@ -28,6 +28,7 @@ #include "soundsource.h" #include "defs_version.h" #include "m4a/ip.h" +#include "util/defs.h" //As per QLibrary docs: http://doc.trolltech.com/4.6/qlibrary.html#resolve #ifdef Q_OS_WIN @@ -42,12 +43,12 @@ class SoundSourceM4A : public SoundSource { public: SoundSourceM4A(QString qFileName); ~SoundSourceM4A(); - int open(); + Result open(); long seek(long); int initializeDecoder(); unsigned read(unsigned long size, const SAMPLE*); unsigned long length(); - int parseHeader(); + Result parseHeader(); static QList<QString> supportedFileExtensions(); private: int trackId; @@ -71,11 +72,11 @@ extern "C" MY_EXPORT SoundSource* getSoundSource(QString filename) return new SoundSourceM4A(filename); } -extern "C" MY_EXPORT char** supportedFileExtensions() +extern "C" MY_EXPORT char** supportedFileExtensions() { QList<QString> exts = SoundSourceM4A::supportedFileExtensions(); //Convert to C string array. - char** c_exts = (char**)malloc((exts.count() + 1) * sizeof(char*)); + char** c_exts = (char**)malloc((exts.count() + 1) * sizeof(char*)); for (int i = 0; i < exts.count(); i++) { QByteArray qba = exts[i].toUtf8(); |