Don't constantly refresh the cd device if it doesn't support checking for media changes.
Filter out irrelevant devices on OS X.
This commit is contained in:
parent
83a21f0576
commit
6d9bc9d3f4
|
@ -119,7 +119,7 @@ void CddaDevice::Init() {
|
||||||
musicbrainz_client->StartDiscIdRequest(musicbrainz_discid);
|
musicbrainz_client->StartDiscIdRequest(musicbrainz_discid);
|
||||||
g_free(string_mb);
|
g_free(string_mb);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean all the Gstreamer objects we have used: we don't need them anymore
|
// Clean all the Gstreamer objects we have used: we don't need them anymore
|
||||||
gst_element_set_state (pipe, GST_STATE_NULL);
|
gst_element_set_state (pipe, GST_STATE_NULL);
|
||||||
gst_object_unref(GST_OBJECT(pipe));
|
gst_object_unref(GST_OBJECT(pipe));
|
||||||
|
@ -154,8 +154,8 @@ void CddaDevice::AudioCDTagsLoaded(const QString& artist, const QString& album,
|
||||||
}
|
}
|
||||||
|
|
||||||
void CddaDevice::Refresh() {
|
void CddaDevice::Refresh() {
|
||||||
if ((cdio_ && cdda_) && /* already init... */
|
if ((cdio_ && cdda_) && /* already init... */
|
||||||
!cdio_get_media_changed(cdio_) /* ...and hasn't change since last time */) {
|
cdio_get_media_changed(cdio_) != 1 /* ...and hasn't change since last time */) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 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)
|
||||||
|
|
|
@ -106,7 +106,15 @@ void CddaLister::Init() {
|
||||||
for (; *devices != NULL; ++devices) {
|
for (; *devices != NULL; ++devices) {
|
||||||
if (strcmp("/dev/cdrom", *devices) == 0)
|
if (strcmp("/dev/cdrom", *devices) == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
QString device(*devices);
|
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;
|
devices_list_ << device;
|
||||||
emit DeviceAdded(device);
|
emit DeviceAdded(device);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue