ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/doomfrontend/doomfrontend
(Generate patch)

Comparing doomfrontend/doomfrontend (file contents):
Revision 1.2 by root, Wed Apr 5 22:12:20 2023 UTC vs.
Revision 1.4 by root, Mon Apr 17 14:08:05 2023 UTC

10 10
11 11
12BEGIN { 12BEGIN {
13 if ($ARGV[0] eq "-=reloaded=-") { 13 if ($ARGV[0] eq "-=reloaded=-") {
14 shift; 14 shift;
15 } elsif (-e "/root/mlockall.so" && $ENV{LD_PRELOAD} !~ /libmimalloc/) { 15 } elsif (-e "/root/mlockall.so") {
16 $ENV{LD_PRELOAD} = "/root/mlockall.so:/root/libmimalloc.so.1.7"; 16 $ENV{LD_PRELOAD} = "/root/mlockall.so:/root/libmimalloc.so.1.7";
17 $ENV{MIMALLOC_LARGE_OS_PAGES} = 1; 17 $ENV{MIMALLOC_LARGE_OS_PAGES} = 1;
18 system "echo always >/sys/kernel/mm/transparent_hugepage/defrag"; 18 system "echo always >/sys/kernel/mm/transparent_hugepage/defrag";
19 system "echo 3 > /proc/sys/vm/drop_caches"; 19 system "echo 3 > /proc/sys/vm/drop_caches";
20 system "echo 1 > /proc/sys/vm/compact_memory"; 20 system "echo 1 > /proc/sys/vm/compact_memory";
21 exec "nice", "-n-20", "ionice", "-c1", $0, "-=reloaded=-", @ARGV; 21 exec "taskset", "-c", "12-15", "nice", "-n-20", "ionice", "-c1", $0, "-=reloaded=-", @ARGV;
22 exit 255; 22 exit 255;
23 } 23 }
24} 24}
25 25
26use common::sense; 26use common::sense;
1239 1239
1240# does not work: deinterlace, because it returns a boolean and expects i have no clue 1240# does not work: deinterlace, because it returns a boolean and expects i have no clue
1241our %SAVE_PROPERTY = (aid => 1, sid => 1, "audio-delay" => 1); 1241our %SAVE_PROPERTY = (aid => 1, sid => 1, "audio-delay" => 1);
1242 1242
1243sub mpv_init { 1243sub mpv_init {
1244 $mpv->start ("--idle=yes", "--pause", "--force-window=no"); # "--start=$playback_start", "--", $mpv_path; 1244 if ($mpv->start ("--idle=yes", "--pause", "--force-window=no")) { # "--start=$playback_start", "--", $mpv_path)
1245 $mpv->{info_page} = 0;
1246 }
1245 1247
1246 for ( 1248 for (
1247 List::Util::pairs qw( 1249 List::Util::pairs qw(
1248 ESC return 1250 ESC return
1249 q return 1251 q return
1316 $playback_start = 0; 1318 $playback_start = 0;
1317 } 1319 }
1318 } 1320 }
1319 1321
1320 win_clear; 1322 win_clear;
1321 win_set 0, "starting video..."; 1323 win_set 0, "starting video..."; _win_refresh;
1322 _win_refresh;
1323 1324
1324 my $mpv_path = $PLAYING_PATH; 1325 my $mpv_path = $PLAYING_PATH;
1325 my $initial_deinterlace; 1326 my $initial_deinterlace;
1326 1327
1327 if (is_myth $mpv_path) { 1328 if (is_myth $mpv_path) {
1438 } else { # HHMMSS 1439 } else { # HHMMSS
1439 $arg = sprintf "%02d:%02d:%02d", $arg / 100 / 100, $arg / 100 % 100, $arg % 100; 1440 $arg = sprintf "%02d:%02d:%02d", $arg / 100 / 100, $arg / 100 % 100, $arg % 100;
1440 } 1441 }
1441 $mpv->cmd ("osd-msg", "seek", $arg, "absolute+exact"); 1442 $mpv->cmd ("osd-msg", "seek", $arg, "absolute+exact");
1442 } else { 1443 } else {
1443 $mpv->cmd ("osd-msg-bar", "show-progress"); 1444 #$mpv->cmd ("osd-msg-bar", "show-progress");
1445
1446 my $info_page = $mpv->{info_page};
1447
1448 if (!$info_page) {
1449 $mpv->cmd ("script-binding", "stats/display-stats-toggle");
1450 }
1451
1452 ++$info_page;
1453
1454 if ($info_page == 4) {
1455 $info_page = 0;
1456 $mpv->cmd ("script-binding", "stats/display-page-1");
1457 $mpv->cmd ("script-binding", "stats/display-stats-toggle");
1458 } else {
1459 $mpv->cmd ("script-binding", "stats/display-page-$info_page");
1460 }
1461
1462 $mpv->{info_page} = $info_page;
1444 } 1463 }
1445 1464
1446 } elsif ($INPUT eq "yellow") { 1465 } elsif ($INPUT eq "yellow") {
1447 $mpv->cmd ("osd-auto", "cycle-values", "osd-level", "2", "3", "0", "1"); 1466 $mpv->cmd ("osd-auto", "cycle-values", "osd-level", "2", "3", "0", "1");
1448 1467

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines