1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-01-03 13:30:26 +01:00

Device fixes for MacOs (#6098)

* Fix setting device for newer MacOs

* Fix setting device if there is an empty description
This commit is contained in:
Jonas Kvinge 2018-07-06 11:04:40 +02:00 committed by John Maguire
parent 4733185d08
commit b897651cdb
2 changed files with 5 additions and 0 deletions

View File

@ -248,6 +248,10 @@ bool GstEnginePipeline::Init() {
case QVariant::Int:
g_object_set(G_OBJECT(audiosink_), "device", device_.toInt(), nullptr);
break;
case QVariant::LongLong:
g_object_set(G_OBJECT(audiosink_), "device", device_.toLongLong(),
nullptr);
break;
case QVariant::String:
g_object_set(G_OBJECT(audiosink_), "device",
device_.toString().toUtf8().constData(), nullptr);

View File

@ -107,6 +107,7 @@ QList<DeviceFinder::Device> OsxDeviceFinder::ListDevices() {
Device dev;
dev.description = QString::fromUtf8(
CFStringGetCStringPtr(*device_name, CFStringGetSystemEncoding()));
if (dev.description.isEmpty()) dev.description = QString("Unknown device");
dev.device_property_value = id;
dev.icon_name = GuessIconName(dev.description);
ret.append(dev);