Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:lastfm/lastfm-desktop

  • Loading branch information...
commit c76eac573a20c61134ff610332ff09e538031670 2 parents a4393ba + 29c28d5
@eartle eartle authored
View
4 admin/qmake/3rdparty.pro.inc
@@ -23,6 +23,10 @@ CONFIG( ffmpeg ) {
PKGCONFIG += libswresample
DEFINES += HAVE_SWRESAMPLE
}
+ packagesExist(libavresample) {
+ PKGCONFIG += libavresample
+ DEFINES += HAVE_AVRESAMPLE
+ }
}
}
View
5 app/fingerprinter/LAV_Source.cpp
@@ -237,10 +237,9 @@ uint8_t * LAV_SourcePrivate::decodeOneFrame(int &dataSize, int &channels, int& n
}
}
- void *pOutBuffer = outBuffer;
+ uint8_t *pOutBuffer = outBuffer;
if (resampleContext)
{
- void **in = (void**)decodedFrame->extended_data;
int outLinesize;
av_samples_get_buffer_size(&outLinesize,
channels,
@@ -250,7 +249,7 @@ uint8_t * LAV_SourcePrivate::decodeOneFrame(int &dataSize, int &channels, int& n
int nSamplesOut = avresample_convert(resampleContext, &pOutBuffer,
outLinesize,
maxOutSamples,
- in,
+ decodedFrame->extended_data,
decodedFrame->linesize[0],
decodedFrame->nb_samples);
if (nSamplesOut < 0)
View
26 lib/unicorn/UnicornCoreApplication.cpp
@@ -23,6 +23,7 @@
#include <lastfm/ws.h>
#include <lastfm/misc.h>
+#include <lastfm/Fingerprint.h>
#include "UnicornCoreApplication.h"
@@ -57,12 +58,14 @@ unicorn::CoreApplication::init()
lastfm::ws::ApiKey = QString( API_KEY ).isEmpty() ? "9e89b44de1ff37c5246ad0af18406454" : API_KEY;
lastfm::ws::SharedSecret = QString( API_SECRET ).isEmpty() ? "147320ea9b8930fe196a4231da50ada4" : API_SECRET;
+#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
#ifdef Q_OS_MAC
QString pluginsDir = applicationDirPath() + "/../plugins";
-#elif defined Q_OS_WIN
+#else
QString pluginsDir = applicationDirPath() + "/plugins";
#endif
addLibraryPath( pluginsDir );
+#endif
dir::runtimeData().mkpath( "." );
@@ -85,7 +88,9 @@ unicorn::CoreApplication::init()
qInstallMsgHandler( qMsgHandler );
qDebug() << "Introducing" << applicationName()+' '+applicationVersion();
qDebug() << "Directed by" << lastfm::platform();
+#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
qDebug() << "Plugin DIR" << pluginsDir;
+#endif
}
@@ -115,3 +120,22 @@ unicorn::CoreApplication::log( const QString& productName )
return dir::logs().filePath( productName + ".debug.log" );
#endif
}
+
+bool
+unicorn::CoreApplication::notify(QObject* receiver, QEvent* event )
+{
+ try
+ {
+ return QCoreApplication::notify( receiver, event );
+ }
+ catch( const lastfm::Fingerprint::Error& e )
+ {
+ qDebug() << "Fingerprint error" << e;
+ qApp->quit();
+ }
+ catch(...)
+ {
+ qDebug() << "Exception caught.";
+ qApp->quit();
+ }
+}
View
4 lib/unicorn/UnicornCoreApplication.h
@@ -49,6 +49,10 @@ namespace unicorn
static QFileInfo log( const QString& productName );
static const char* platformString();
+
+ // We need to catch exceptions from event handlers.
+ // liblastfm-fingerprint is a bit exception happy...
+ virtual bool notify ( QObject * receiver, QEvent * event );
};
}
Please sign in to comment.
Something went wrong with that request. Please try again.