Print a warning when plugin rank cannot be changed

This commit is contained in:
Rafostar
2021-04-25 22:00:00 +02:00
parent a98ca53dfb
commit e92ad68220
2 changed files with 27 additions and 11 deletions

View File

@@ -6,7 +6,7 @@ const YouTube = imports.src.youtube;
const { PlaylistWidget } = imports.src.playlist;
const { WebApp } = imports.src.webApp;
const { debug } = Debug;
const { debug, warn } = Debug;
const { settings } = Misc;
let WebServer;
@@ -119,8 +119,10 @@ class ClapperPlayer extends GstClapper.Clapper
{
const gstRegistry = Gst.Registry.get();
const feature = gstRegistry.lookup_feature(name);
if(!feature)
return debug(`plugin unavailable: ${name}`);
if(!feature) {
warn(`cannot change rank of unavailable plugin: ${name}`);
return;
}
const oldRank = feature.get_rank();
if(rank === oldRank)