diff options
author | Cecil Hugh Watson <knoppmyth@gmail.com> | 2009-07-14 02:25:24 (GMT) |
---|---|---|
committer | Cecil Hugh Watson <knoppmyth@gmail.com> | 2009-07-14 02:25:24 (GMT) |
commit | b08d687d99a8df0e2c0be8e1746a8456518edb8e (patch) | |
tree | 840fed35616837616ae0c509bdcc79301840902b /abs/core-testing/tweaker/bin | |
parent | a6476c77e1cc295d4b8debaea2d0dfbeae0f7b01 (diff) | |
parent | 4c71823825d08c1cc2219d22a6d3fe190e158a09 (diff) | |
download | linhes_pkgbuild-b08d687d99a8df0e2c0be8e1746a8456518edb8e.zip linhes_pkgbuild-b08d687d99a8df0e2c0be8e1746a8456518edb8e.tar.gz linhes_pkgbuild-b08d687d99a8df0e2c0be8e1746a8456518edb8e.tar.bz2 |
Merge branch 'HEAD' of ssh://cesman@knoppmyth.net/mount/repository/LinHES-PKGBUILD
Conflicts:
abs/core-testing/LinHES-config/PKGBUILD
Diffstat (limited to 'abs/core-testing/tweaker/bin')
-rwxr-xr-x | abs/core-testing/tweaker/bin/twk_audio.pl | 12 | ||||
-rwxr-xr-x | abs/core-testing/tweaker/bin/twk_cpu.pl | 31 | ||||
-rwxr-xr-x | abs/core-testing/tweaker/bin/twk_general.pl | 8 |
3 files changed, 44 insertions, 7 deletions
diff --git a/abs/core-testing/tweaker/bin/twk_audio.pl b/abs/core-testing/tweaker/bin/twk_audio.pl index eec7992..47a2415 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; @@ -160,6 +160,14 @@ sub implement_option { } } } + # for all options + $command2 = "echo -e 'af=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."); + exit(-1); + } + $logger->info("Edited $mplayer_conf for $option audio."); } 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'); |