diff --git a/avdecoder.cpp b/avdecoder.cpp index db844d8..e203f6f 100644 --- a/avdecoder.cpp +++ b/avdecoder.cpp @@ -78,7 +78,7 @@ void AVDecoder::getVideoMetadata(metadata_t &metadata) if((entry = av_dict_get(file_metadata, "title", NULL, 0)) != NULL) { metadata.data.video.title = strdup(entry->value); } else { - metadata.data.video.title = metadata.name; + metadata.data.video.title = strdup(metadata.name); } metadata.data.video.tracks->data.track_video.duration = pFormatCtx->duration / 1000; diff --git a/baseworker.cpp b/baseworker.cpp index ae161f2..48abfed 100644 --- a/baseworker.cpp +++ b/baseworker.cpp @@ -29,10 +29,14 @@ void BaseWorker::onFinished() { } -void BaseWorker::start() +void BaseWorker::start(const char *thread_name) { thread = new QThread(); + if(thread_name) { + thread->setObjectName(thread_name); + } + // Move this service to a new thread this->moveToThread(thread); diff --git a/baseworker.h b/baseworker.h index ccbf9a0..8c8f915 100644 --- a/baseworker.h +++ b/baseworker.h @@ -30,7 +30,7 @@ class BaseWorker : public QObject public: explicit BaseWorker(QObject *parent = 0); - void start(); + void start(const char *thread_name = NULL); private: QThread *thread; diff --git a/cmaclient.cpp b/cmaclient.cpp index e0f79bd..a2c431b 100644 --- a/cmaclient.cpp +++ b/cmaclient.cpp @@ -71,7 +71,7 @@ vita_device_t *CmaClient::getDeviceConnection() break; } qDebug("No Vita detected via USB, attempt %i", ++num_tries); - vita = VitaMTP_Get_First_Wireless_Vita(&host, 0, 0, CmaClient::deviceRegistered, CmaClient::generatePin); + vita = VitaMTP_Get_First_Wireless_Vita(&host, 0, 3, CmaClient::deviceRegistered, CmaClient::generatePin); if(vita || !active) { break; } diff --git a/cmarootobject.cpp b/cmarootobject.cpp index afbac7b..0d5ce93 100644 --- a/cmarootobject.cpp +++ b/cmarootobject.cpp @@ -37,7 +37,7 @@ void CMARootObject::initObject(const QString &path) case VITA_OHFI_MUSIC: metadata.dataType = Music; this->path = path; - num_filters = 1; + num_filters = 2; filters = new metadata_t[2]; //createFilter(&filters[0], "Artists", VITA_DIR_TYPE_MASK_MUSIC | VITA_DIR_TYPE_MASK_ROOT | VITA_DIR_TYPE_MASK_ARTISTS); createFilter(&filters[0], "Albums", VITA_DIR_TYPE_MASK_MUSIC | VITA_DIR_TYPE_MASK_ROOT | VITA_DIR_TYPE_MASK_ALBUMS); diff --git a/database.cpp b/database.cpp index d38ef8f..e17e9a9 100644 --- a/database.cpp +++ b/database.cpp @@ -165,6 +165,8 @@ void Database::destroy() QMutexLocker locker(&mutex); for(map_list::iterator root = object_list.begin(); root != object_list.end(); ++root) { + CMARootObject *first = static_cast((*root).takeFirst()); + delete first; qDeleteAll(*root); } diff --git a/mainwidget.cpp b/mainwidget.cpp index 4a283e4..268a058 100644 --- a/mainwidget.cpp +++ b/mainwidget.cpp @@ -66,7 +66,7 @@ void MainWidget::dialogResult(int result) void MainWidget::startServer() { qDebug("Starting cma event loop"); - clientLoop.start(); + clientLoop.start("CmaClient"); } void MainWidget::stopServer()