projects
/
HTML5TV.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d62ee8
)
jump to current position in subtitle.srt.yaml
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 16 Dec 2009 19:39:55 +0000
(20:39 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 16 Dec 2009 19:39:55 +0000
(20:39 +0100)
bin/mplayer.pl
patch
|
blob
|
history
diff --git
a/bin/mplayer.pl
b/bin/mplayer.pl
index
cfebbd8
..
7f476dd
100755
(executable)
--- a/
bin/mplayer.pl
+++ b/
bin/mplayer.pl
@@
-557,7
+557,14
@@
sub load_subtitles {
sub edit_subtitles {
print $to_mplayer qq|pause\n|;
focus_term;
- system( qq|vi "$subtitles.yaml"| ) == 0 and load_subtitles;
+ my $line = 1;
+ open( my $fh, '<', "$subtitles.yaml" ) || die $1;
+ while(<$fh>) {
+ last if /^-\s([\d\.]+)/ && $1 > $pos;
+ $line++;
+ }
+ close($fh);
+ system( qq|vi +$line "$subtitles.yaml"| ) == 0 and load_subtitles;
focus_mplayer;
}