diff --git a/src/devices/cddadevice.cpp b/src/devices/cddadevice.cpp index e60ef2e4e..e4d56f199 100644 --- a/src/devices/cddadevice.cpp +++ b/src/devices/cddadevice.cpp @@ -119,7 +119,7 @@ void CddaDevice::Init() { musicbrainz_client->StartDiscIdRequest(musicbrainz_discid); g_free(string_mb); } - + // Clean all the Gstreamer objects we have used: we don't need them anymore gst_element_set_state (pipe, GST_STATE_NULL); gst_object_unref(GST_OBJECT(pipe)); @@ -154,8 +154,8 @@ void CddaDevice::AudioCDTagsLoaded(const QString& artist, const QString& album, } void CddaDevice::Refresh() { - if ((cdio_ && cdda_) && /* already init... */ - !cdio_get_media_changed(cdio_) /* ...and hasn't change since last time */) { + if ((cdio_ && cdda_) && /* already init... */ + cdio_get_media_changed(cdio_) != 1 /* ...and hasn't change since last time */) { return; } // Check if mutex is already token (i.e. init is already taking place) diff --git a/src/devices/cddalister.cpp b/src/devices/cddalister.cpp index 25faa4b26..179dcc303 100644 --- a/src/devices/cddalister.cpp +++ b/src/devices/cddalister.cpp @@ -106,7 +106,15 @@ void CddaLister::Init() { for (; *devices != NULL; ++devices) { if (strcmp("/dev/cdrom", *devices) == 0) continue; + QString device(*devices); +#ifdef Q_OS_DARWIN + // Every track is detected as a separate device on Darwin. The raw disk looks + // like /dev/rdisk1 + if (!device.contains(QRegExp("^/dev/rdisk[0-9]$"))) { + continue; + } +#endif devices_list_ << device; emit DeviceAdded(device); }