summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Igo <bob@stormlogic.com>2009-07-15 19:18:52 (GMT)
committerBob Igo <bob@stormlogic.com>2009-07-15 19:18:52 (GMT)
commit0c8f5ba689416ba6f11fd176e6c1fd61207c477e (patch)
treec21102c985894e45d793442c5f15a85ed57c5ee5
parentf301d235fc7955336a38ae4181edcf6961446cd1 (diff)
downloadlinhes_pkgbuild-0c8f5ba689416ba6f11fd176e6c1fd61207c477e.zip
linhes_pkgbuild-0c8f5ba689416ba6f11fd176e6c1fd61207c477e.tar.gz
linhes_pkgbuild-0c8f5ba689416ba6f11fd176e6c1fd61207c477e.tar.bz2
wrapper now lets command-line options override dynamic ones
-rw-r--r--abs/core-testing/mplayer-wrapper/PKGBUILD2
-rwxr-xr-xabs/core-testing/mplayer-wrapper/mplayer-wrapper.pl29
2 files changed, 25 insertions, 6 deletions
diff --git a/abs/core-testing/mplayer-wrapper/PKGBUILD b/abs/core-testing/mplayer-wrapper/PKGBUILD
index b9e3aef..52ccbd4 100644
--- a/abs/core-testing/mplayer-wrapper/PKGBUILD
+++ b/abs/core-testing/mplayer-wrapper/PKGBUILD
@@ -1,6 +1,6 @@
pkgname=mplayer-wrapper
pkgver=1
-pkgrel=2
+pkgrel=3
pkgdesc="wrapper for mplayer and mplayer derivatives"
arch=('i686' 'x86_64')
diff --git a/abs/core-testing/mplayer-wrapper/mplayer-wrapper.pl b/abs/core-testing/mplayer-wrapper/mplayer-wrapper.pl
index 2d823d9..646b675 100755
--- a/abs/core-testing/mplayer-wrapper/mplayer-wrapper.pl
+++ b/abs/core-testing/mplayer-wrapper/mplayer-wrapper.pl
@@ -38,9 +38,28 @@ sub run () {
my $mediafile = @ARGV[$#ARGV];
my $player = &pick_player();
+ # mplayer evaluates configuration options in the following order, with
+ # later-evaluated options overriding earlier-evaluated ones, both within
+ # a given configuration location and between them:
+ # 1) system-wide configuration/profiles, /etc/mplayer/mplayer.conf
+ # 2) user-specific configuration/profiles, ~/.mplayer/config
+ # 3) commandline configuration parameters
+ # 4) file-specific configuration, ~/.mplayer/[filename].conf
+ # 5) any nonstandard configuration file, included via "-include" parameter
+ #
+ # This script's dynamic configuration options fall in at 2.5 above,
+ # so commandline options, file-specific configuration options,
+ # or a nonstandard configuration file will override the options that
+ # the script creates, but system-wide and user-specific configuration
+ # will be overridden by the dynamic configuration options.
+ #
+ # This is sub-optimal, as the easiest way for a user to compensate for
+ # a misfiring configuration rule would be to override it in a configuration
+ # file. Instead, they will have to change the way they run this script.
+
my $player_parameters = join(' ',
- &translate_parameters($player,@ARGV[0..$#ARGV-1]),
- &dynamic_parameters($mediafile));
+ &dynamic_parameters($mediafile),
+ &translate_parameters($player,@ARGV[0..$#ARGV-1]));
&player($player,$player_parameters,$mediafile);
}
@@ -98,13 +117,13 @@ sub dynamic_parameters () {
push(@parameters, "-vo vdpau");
push(@parameters, "-vc ffmpeg12vdpau");
- # problems reported with WMV3 support
+ # problems have been reported with WMV3 support
# } elsif ($codec eq "ffwmv3") { # WMV3
# push(@parameters, "-vo vdpau");
# push(@parameters, "-vc ffwmv3vdpau");
- # problems reported with WVC1 support
+ # problems have been reported with WVC1 support
# } elsif ($codec eq "ffvc1") { # WVC1
# push(@parameters, "-vo vdpau");
@@ -144,7 +163,7 @@ sub player () {
my($player,$parameters,$mediafile)=@_;
my $command = "$player $parameters \"$mediafile\" 2>&1 |";
- print "DEBUG: command is:\n$command\n";
+ print "DEBUG: $0's player command is: *** $command ***\n";
open(SHELL, $command);
while (<SHELL>) {
print $_;