added minimum slide height
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 22 Oct 2009 12:06:41 +0000 (14:06 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 22 Oct 2009 12:06:41 +0000 (14:06 +0200)
bin/mplayer.pl

index ac1207d..ffc4d49 100755 (executable)
@@ -61,6 +61,8 @@ my $preroll = 3;
 
 my $slide_factor = 4; # 1/4 size of video
 
+my $min_slide_height = 480;
+
 our $to_mplayer;
 our $from_mplayer;
 our $err_mplayer;
@@ -263,8 +265,10 @@ sub html5tv {
                        my $file = slide_jpg( $factor => $nr );
                        next if -e $file;
 
-                       my $w = $prop->{height} / $factor * $slide_aspect;
-                       my $h = $prop->{height} / $factor;
+                       $min_slide_height = $prop->{height} if $prop->{height} > $min_slide_height;
+
+                       my $w = $min_slide_height / $factor * $slide_aspect;
+                       my $h = $min_slide_height / $factor;
 
                        warn "slide [$nr] $hires -> ${w}x${h} $file\n";