create directories for slides by resolution
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 10 Oct 2009 22:31:51 +0000 (00:31 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 10 Oct 2009 22:31:51 +0000 (00:31 +0200)
bin/mplayer.pl

index 7d1797b..c067e7b 100755 (executable)
@@ -126,6 +126,18 @@ sub html5tv {
        write_file $sync_path, "var html5tv = " . to_json($html5tv) . " ;\n";
        warn "sync $sync_path ", -s $sync_path, " bytes\n";
 
+       if ( $prop->{width} && $prop->{height} ) {
+               foreach my $factor ( 1, 2, 4 ) {
+                       my $w = $prop->{width}  / $factor;
+                       my $h = $prop->{height} / $factor;
+                       my $path = "www/s/${w}x${h}";
+                       if ( ! -d $path ) {
+                               mkdir $path;
+                               warn "created $path\n";
+                       }
+               }
+       }
+
 }