|
@@ -79,11 +79,17 @@ public class DBusMediaSource extends Plugin implements MediaSourceManager {
|
79
|
79
|
@Override
|
80
|
80
|
public List<MediaSource> getSources() {
|
81
|
81
|
for (String mpris : doDBusCall("org.mpris.*", "/", "/")) {
|
82
|
|
- final String service = mpris.substring(10);
|
83
|
|
-
|
84
|
|
- if (!mprisSources.containsKey(service)) {
|
85
|
|
- mprisSources.put(service, new MPRISSource(this, service));
|
86
|
|
- sources.add(mprisSources.get(service));
|
|
82
|
+ try {
|
|
83
|
+ final String service = mpris.substring(10);
|
|
84
|
+
|
|
85
|
+ if (!mprisSources.containsKey(service)) {
|
|
86
|
+ mprisSources.put(service, new MPRISSource(this, service));
|
|
87
|
+ sources.add(mprisSources.get(service));
|
|
88
|
+ }
|
|
89
|
+ } catch (IllegalArgumentException ex) {
|
|
90
|
+ // The service either stopped after the initial call and before
|
|
91
|
+ // we created an MRPIS Source, or otherwise doesn't correctly
|
|
92
|
+ // implement MPRIS. Either way, ignore it.
|
87
|
93
|
}
|
88
|
94
|
}
|
89
|
95
|
|