Update VLC backend for Phonon to 0.8.2, and add a few patches from upstream.

Among others, this should fix "no devices" problem.
This commit is contained in:
zhuk 2015-07-05 00:47:36 +00:00
parent 9453cfdcc5
commit 16f3be1429
4 changed files with 95 additions and 7 deletions

View File

@ -1,11 +1,8 @@
# $OpenBSD: Makefile,v 1.4 2015/05/28 10:17:24 pascal Exp $
# $OpenBSD: Makefile,v 1.5 2015/07/05 00:47:36 zhuk Exp $
COMMENT = VLC-based Phonon backend
VERSION = 0.8.0
VERSION = 0.8.2
DISTNAME = phonon-backend-vlc-${VERSION}
REVISION = 0
MASTER_SITES = ${MASTER_SITE_KDE:=stable/phonon/phonon-backend-vlc/${VERSION}/}
LIB_DEPENDS = x11/vlc>=2

View File

@ -1,2 +1,2 @@
SHA256 (phonon-backend-vlc-0.8.0.tar.xz) = 4JIYW6d5i2XaDuJwfk69sy1NGFgoL1u5a86JAzaTikI=
SIZE (phonon-backend-vlc-0.8.0.tar.xz) = 59076
SHA256 (phonon-backend-vlc-0.8.2.tar.xz) = 2rf47fU+6QmY5eP88va9ChN1BRGw7N5pOb4GZNRr2qM=
SIZE (phonon-backend-vlc-0.8.2.tar.xz) = 59832

View File

@ -0,0 +1,73 @@
$OpenBSD: patch-src_devicemanager_cpp,v 1.1 2015/07/05 00:47:36 zhuk Exp $
Fix runtime problems with VLC 2.2.
From upstream.
--- src/devicemanager.cpp.orig Thu Dec 4 12:29:23 2014
+++ src/devicemanager.cpp Sun Jul 5 03:39:25 2015
@@ -239,6 +239,35 @@ void DeviceManager::updateDeviceList()
continue;
}
+ // FIXME: there is a rather ungodly amount of code duplication going
+ // on here.
+#if (LIBVLC_VERSION_INT >= LIBVLC_VERSION(2, 2, 0, 0))
+ bool hasDevices = false;
+ VLC_FOREACH(audio_output_device,
+ device,
+ libvlc_audio_output_device_list_get(libvlc, soundSystem),
+ libvlc_audio_output_device_list_release) {
+ QString idName = QString::fromUtf8(device->psz_device);
+ QString longName = QString::fromUtf8(device->psz_description);
+
+ debug() << "found device" << soundSystem << idName << longName;
+
+ DeviceInfo info(longName, true);
+ info.addAccess(DeviceAccess(soundSystem, idName));
+ info.setCapabilities(DeviceInfo::AudioOutput);
+ newDeviceList.append(info);
+
+ hasDevices = true;
+ }
+
+ if (!hasDevices) {
+ debug() << "manually injecting sound system" << soundSystem;
+ DeviceInfo info(QString::fromUtf8(soundSystem), false);
+ info.addAccess(DeviceAccess(soundSystem, ""));
+ info.setCapabilities(DeviceInfo::AudioOutput);
+ newDeviceList.append(info);
+ }
+#else
const int deviceCount = libvlc_audio_output_device_count(libvlc, soundSystem);
for (int i = 0; i < deviceCount; i++) {
@@ -247,10 +276,10 @@ void DeviceManager::updateDeviceList()
debug() << "found device" << soundSystem << idName << longName;
- DeviceInfo device(longName, true);
- device.addAccess(DeviceAccess(soundSystem, idName));
- device.setCapabilities(DeviceInfo::AudioOutput);
- newDeviceList.append(device);
+ DeviceInfo info(longName, true);
+ info.addAccess(DeviceAccess(soundSystem, idName));
+ info.setCapabilities(DeviceInfo::AudioOutput);
+ newDeviceList.append(info);
}
// libVLC gives no devices for some sound systems, like OSS
@@ -261,11 +290,12 @@ void DeviceManager::updateDeviceList()
// selection which on systems such as OSX or Windows can
// lead to an empty device list as the injected device is
// the only available one.
- DeviceInfo device(QString::fromUtf8(soundSystem), false);
- device.addAccess(DeviceAccess(soundSystem, ""));
- device.setCapabilities(DeviceInfo::AudioOutput);
- newDeviceList.append(device);
+ DeviceInfo info(QString::fromUtf8(soundSystem), false);
+ info.addAccess(DeviceAccess(soundSystem, ""));
+ info.setCapabilities(DeviceInfo::AudioOutput);
+ newDeviceList.append(info);
}
+#endif
}
/*

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-src_mediaobject_cpp,v 1.1 2015/07/05 00:47:36 zhuk Exp $
Bugfix from upstream.
--- src/mediaobject.cpp.orig Thu Dec 4 12:29:23 2014
+++ src/mediaobject.cpp Sun Jul 5 03:39:25 2015
@@ -319,8 +319,11 @@ void MediaObject::setSource(const MediaSource &source)
case MediaSource::Url:
debug() << "MediaSource::Url:" << source.url();
if (source.url().scheme().isEmpty()) {
- url = "file:///";
- if (source.url().isRelative())
+ url = "file://";
+ // QUrl considers url.scheme.isEmpty() == url.isRelative(),
+ // so to be sure the url is not actually absolute we just
+ // check the first character
+ if (!source.url().toString().startsWith('/'))
url.append(QFile::encodeName(QDir::currentPath()) + '/');
}
url += source.url().toEncoded();