Permalink
Browse files

fix mpv disabled when using mpv version from git (Close #105)

  • Loading branch information...
squentin committed Sep 2, 2015
1 parent e6436fc commit 91892d9274ee6dbbac0ff0d4493aabe755ab327b
Showing with 5 additions and 5 deletions.
  1. +5 −5 gmusicbrowser_mpv.pm
View
@@ -45,11 +45,11 @@ sub init
sub check_version
{ return unless $mpv;
my $output= qx/$mpv -V/;
my $ok= $output=~m/mpv\s*(\d+)\.(\d+)(\S+)?/i && ($1>0 || $2>=7) ? 1 : 0; #requires version 0.7 or later
if ($::debug)
{ if (defined $1) { warn "mpv: found mpv v$1.$2".($3||"")."\n"; }
else {warn "mpv: error looking up mpv version\n"}
}
my ($ok,$version);
if ($output=~m/mpv\s*(\d+)\.(\d+)(\S+)?/i) { $ok= $1>0 || $2>=7; $version= "$1.$2".($3||"") } #requires version 0.7 or later
elsif ($output=~m/mpv\s*(git-[[:xdigit:]]+)/i) { $ok=1; $version=$1; } #assume git version is ok
else { warn "mpv: error looking up mpv version\n"; }
warn "mpv: found mpv version $version\n" if $version && ($::debug || !$ok);
if (!$ok) { warn "mpv version earlier than 0.7 are not supported -> mpv backend disabled\n" }
return $ok;
}

0 comments on commit 91892d9

Please sign in to comment.