summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/tweaker/bin
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core-testing/tweaker/bin')
-rwxr-xr-xabs/core-testing/tweaker/bin/twk_audio.pl6
-rwxr-xr-xabs/core-testing/tweaker/bin/twk_cpu.pl31
-rwxr-xr-xabs/core-testing/tweaker/bin/twk_general.pl8
3 files changed, 37 insertions, 8 deletions
diff --git a/abs/core-testing/tweaker/bin/twk_audio.pl b/abs/core-testing/tweaker/bin/twk_audio.pl
index eec7992..09676ed 100755
--- a/abs/core-testing/tweaker/bin/twk_audio.pl
+++ b/abs/core-testing/tweaker/bin/twk_audio.pl
@@ -110,9 +110,9 @@ sub implement_option {
sub edit_mplayer_conf {
my($option) = @_;
# delete any old entries that Tweaker made, relevant to this particular edit
- my $delete_old_tweaker_edits = "[ -e $mplayer_conf ] && sed -i '/^.*a[o,c].*=.*#TWEAKER/d' $mplayer_conf";
+ my $delete_old_tweaker_edits = "[ -e $mplayer_conf ] && sed -i '/^.*a[o,c,f].*=.*#TWEAKER/d' $mplayer_conf && sed -i '/^speed.*=.*#TWEAKER/d' $mplayer_conf";
# comment out old entries that some other process may have made
- my $comment_out_external_edits = "[ -e $mplayer_conf ] && sed -i 's/^\\(a[o,c].*=.*\\)/#\\1/g' $mplayer_conf";
+ my $comment_out_external_edits = "[ -e $mplayer_conf ] && sed -i 's/^\\(a[o,c,f].*=.*\\)/#\\1/g' $mplayer_conf && sed -i 's/^\\(speed.*=.*\\)/#\\1/g' $mplayer_conf";
my $command1;
my $command2="";
($card, $device) = poll_for_digital_output_device;
@@ -133,7 +133,7 @@ sub implement_option {
# Not supported yet.
}
case "digital" {
- $command2 = "echo -e 'ac=hwac3,hwdts, #TWEAKER\nao=alsa:device=plughw=$card.$device #TWEAKER' >> $mplayer_conf";
+ $command2 = "echo -e 'ac=hwac3,hwdts, #TWEAKER\nao=alsa:device=plughw=$card.$device #TWEAKER\naf=scaletempo=stride=30:overlap=.50:search=10 #TWEAKER\nspeed=1.0 #TWEAKER' >> $mplayer_conf";
if (my $error = execute_shell_command($command2)) {
$logger->error("ERROR: $error");
$logger->error("ERROR: Unable to implement option $option.");
diff --git a/abs/core-testing/tweaker/bin/twk_cpu.pl b/abs/core-testing/tweaker/bin/twk_cpu.pl
index 118bac1..8bddbe3 100755
--- a/abs/core-testing/tweaker/bin/twk_cpu.pl
+++ b/abs/core-testing/tweaker/bin/twk_cpu.pl
@@ -57,6 +57,36 @@ sub get_HDD_size {
#
#}
+# Edit mplayer.conf to tell mplayer to drop video frames when necessary. This should do no harm
+# on systems that don't need the option, and it should make video watchable on those that do.
+sub edit_mplayer_conf {
+ use vars qw($mplayer_conf);
+ $mplayer_conf = "/etc/mplayer/mplayer.conf";
+
+ # delete any old entries that Tweaker made, relevant to this particular edit
+ my $delete_old_tweaker_edits = "[ -e $mplayer_conf ] && sed -i '/^.*hardframedrop.*=.*#TWEAKER/d' $mplayer_conf";
+ # comment out old entries that some other process may have made
+ my $comment_out_external_edits = "[ -e $mplayer_conf ] && sed -i 's/^\\(hardframedrop.*=.*\\)/#\\1/g' $mplayer_conf";
+ my $command1;
+ my $command2="";
+ my $logger = get_logger('tweaker.script');
+
+ if (my $error = execute_shell_command("$delete_old_tweaker_edits && $comment_out_external_edits")) {
+ $logger->error("ERROR: $error");
+ $logger->error("ERROR: Unable to implement option $option.");
+ exit(-1);
+ }
+
+ $command2 = "echo -e 'hardframedrop=true #TWEAKER' >> $mplayer_conf";
+ if (my $error = execute_shell_command($command2)) {
+ $logger->error("ERROR: $error");
+ $logger->error("ERROR: Unable to implement option $option.");
+ exit(-1);
+ }
+
+ $logger->info("Edited $mplayer_conf to drop video frames when CPU is overloaded.");
+}
+
# Try to implement the given option.
sub implement_option {
my($option) = @_;
@@ -106,6 +136,7 @@ sub implement_option {
change_or_make_setting('OSDTheme', 'blootube-osd') || exit -1;
change_or_make_setting('PlayBoxShading', '0') || exit -1;
change_or_make_setting('PlaybackExitPrompt', '2') || exit -1;
+ edit_mplayer_conf();
} else {
exit -1;
}
diff --git a/abs/core-testing/tweaker/bin/twk_general.pl b/abs/core-testing/tweaker/bin/twk_general.pl
index 387920c..3d16f2c 100755
--- a/abs/core-testing/tweaker/bin/twk_general.pl
+++ b/abs/core-testing/tweaker/bin/twk_general.pl
@@ -87,10 +87,8 @@ sub implement_option {
#
# better awareness of different video extensions
#
- change_or_make_entry("videotypes", [["playcommand", "mplayer-resumer.pl -fs -zoom -vc theora,fftheora, -vo xv %s"]], [["extension", "ogg"]]);
- change_or_make_entry("videotypes", [["playcommand", "mplayer-resumer.pl -fs -zoom -vc theora,fftheora, -vo xv %s"]], [["extension", "theora"]]);
- foreach my $video_ext ("mp2", "tp", "ts", "m2p", "nuv", "mkv") {
- change_or_make_entry("videotypes", [["playcommand", "Internal"], ["f_ignore", "0"], ["use_default", "1"]], [["extension", $video_ext]]);
+ foreach my $video_ext ("mp2", "tp", "ts", "m2p", "nuv", "mkv", "ogg", "theora") {
+ change_or_make_entry("videotypes", [["playcommand", "Default"], ["f_ignore", "0"], ["use_default", "1"]], [["extension", $video_ext]]);
}
foreach my $non_video_ext ("jpg", "par2") {
change_or_make_entry("videotypes", [["f_ignore", "1"]], [["extension", $non_video_ext]]);
@@ -415,7 +413,7 @@ sub implement_option {
change_or_make_setting('VCDPlayerCommand', 'mplayer vcd:\/\/ -cdrom-device %d -fs -zoom -vo xv -vf pp=lb');
change_or_make_setting('VideoArtworkDir', "$SQL_DirVideo/.covers");
change_or_make_setting('VideoBrowserNoDB', '1');
- change_or_make_setting('VideoDefaultPlayer', 'mplayer-resumer.pl -fs -zoom -vo xv %s');
+ change_or_make_setting('VideoDefaultPlayer', 'mplayer-wrapper.pl -fs -zoom %s');
change_or_make_setting('VideoGalleryNoDB', '1');
change_or_make_setting('VideoStartupDir', $SQL_DirVideo);
change_or_make_setting('VideoTreeNoDB', '1');