mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-02-10 00:30:41 +01:00
Fix crash in CD songloader
This commit is contained in:
parent
f75acf820c
commit
5b0b924d34
@ -77,9 +77,7 @@ void CddaSongLoader::LoadSongs() {
|
|||||||
if (error) {
|
if (error) {
|
||||||
Error(QString("%1: %2").arg(error->code).arg(error->message));
|
Error(QString("%1: %2").arg(error->code).arg(error->message));
|
||||||
}
|
}
|
||||||
if (cdda_ == nullptr) {
|
if (!cdda_) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!url_.isEmpty()) {
|
if (!url_.isEmpty()) {
|
||||||
g_object_set(cdda_, "device", g_strdup(url_.path().toLocal8Bit().constData()), nullptr);
|
g_object_set(cdda_, "device", g_strdup(url_.path().toLocal8Bit().constData()), nullptr);
|
||||||
@ -242,7 +240,7 @@ void CddaSongLoader::AudioCDTagsLoaded(const QString &artist, const QString &alb
|
|||||||
|
|
||||||
bool CddaSongLoader::HasChanged() {
|
bool CddaSongLoader::HasChanged() {
|
||||||
|
|
||||||
if ((cdio_ && cdda_) && cdio_get_media_changed(cdio_) != 1) {
|
if (cdio_ && cdio_get_media_changed(cdio_) != 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Check if mutex is already token (i.e. init is already taking place)
|
// Check if mutex is already token (i.e. init is already taking place)
|
||||||
@ -250,6 +248,7 @@ bool CddaSongLoader::HasChanged() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
mutex_load_.unlock();
|
mutex_load_.unlock();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user