summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-02-26 17:18:58 +0100
committerTheTroll <trolldev@gmail.com>2010-02-26 17:18:58 +0100
commit398df164f62f5296fc7cd186eae02891881f5dc0 (patch)
tree2ac3621ac5b3728f5e7951a5541943ed3695925c
parent5779611e7d547302ed9847448acce65e07439b3d (diff)
downloadistreamdev-398df164f62f5296fc7cd186eae02891881f5dc0.tar.gz
istreamdev-398df164f62f5296fc7cd186eae02891881f5dc0.tar.bz2
Use the right A/R for external thumbs too
-rwxr-xr-xincludes/inc_files.php34
1 files changed, 24 insertions, 10 deletions
diff --git a/includes/inc_files.php b/includes/inc_files.php
index b625a7c..a13478c 100755
--- a/includes/inc_files.php
+++ b/includes/inc_files.php
@@ -25,20 +25,34 @@ function mediagetinfostream($stream = "")
exec("rm ram/stream-tb.*");
$path = dirname($stream);
- // Get the right Y resolution
- if ($fileinfo['video']['resolution_y'] && $fileinfo['video']['resolution_x'])
- $resy = ($fileinfo['video']['resolution_y'] * 180) / $fileinfo['video']['resolution_x'];
- else
- $resy = 100;
+ //Default res Y
+ $resy = 100;
if (file_exists(substr($stream, 0, -4) .".tbn"))
- exec("cp \"" .substr($stream, 0, -4) .".tbn\" ram/stream-tb-tmp.jpg; " .$ffmpegpath ." -y -i ram/stream-tb-tmp.jpg -s 128x180 ram/stream-tb.jpg");
- else if (file_exists($path ."/poster.jpg"))
- exec($ffmpegpath ." -y -i \"" .$path ."/poster.jpg\" -s 128x180 ram/stream-tb.jpg");
- else if (file_exists($path ."/folder.jpg"))
- exec($ffmpegpath ." -y -i \"" .$path ."/folder.jpg\" -s 128x180 ram/stream-tb.jpg");
+ $file = substr($stream, 0, -4) .".tbn";
+ else if (file_exists($path ."/poster.jpg"))
+ $file = $path ."/poster.jpg";
+ else if (file_exists($path ."/folder.jpg"))
+ $file = $path ."/folder.jpg";
else
+ $file = "";
+
+ if ($file)
+ {
+ $getid3 = new getID3;
+ $fileinfo = $getid3->analyze($file);
+ if ($fileinfo['video']['resolution_y'] && $fileinfo['video']['resolution_x'])
+ $resy = ($fileinfo['video']['resolution_y'] * 180) / $fileinfo['video']['resolution_x'];
+
+ exec("cp \"" .$file ."\" ram/stream-tb-tmp.jpg; " .$ffmpegpath ." -y -i ram/stream-tb-tmp.jpg -s 128x" .$resy ." ram/stream-tb.jpg");
+ }
+ else
+ {
+ if ($fileinfo['video']['resolution_y'] && $fileinfo['video']['resolution_x'])
+ $resy = ($fileinfo['video']['resolution_y'] * 180) / $fileinfo['video']['resolution_x'];
+
exec($ffmpegpath ." -y -i \"" .$stream ."\" -an -ss 00:00:05.00 -r 1 -vframes 1 -s 180x" .$resy ." -f mjpeg ram/stream-tb.png");
+ }
return array($title, $info);
}