From d22a60172f77d567a08437f804a44ec1569268bd Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Thu, 15 Oct 2009 14:07:15 +0200 Subject: [PATCH] don't die for prev/next subtitle without them --- bin/mplayer.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/mplayer.pl b/bin/mplayer.pl index 9d23196..f711757 100755 --- a/bin/mplayer.pl +++ b/bin/mplayer.pl @@ -466,7 +466,7 @@ sub sub_fmt { sub prev_subtitle { my $pos = time_pos; - my $s = ( grep { $_->[0] < $pos } @subtitles )[0]; + my $s = ( grep { $_->[0] < $pos } @subtitles )[0] || return; warn "<<<< subtitle ", sub_fmt $s; preroll $s->[0], $s->[2]; # print $to_mplayer "set_property time_pos $s->[0]\n"; @@ -474,7 +474,7 @@ sub prev_subtitle { sub next_subtitle { my $pos = time_pos + $preroll; - my $s = ( grep { $_->[0] > $pos } @subtitles )[0]; + my $s = ( grep { $_->[0] > $pos } @subtitles )[0] || return; warn ">>>> subtitle ", sub_fmt $s; preroll $s->[0], $s->[2]; # print $to_mplayer "set_property time_pos $s->[0]\n"; -- 2.20.1