From 3d10d019a5d8dadac44bbda24b2b8ff2a99da258 Mon Sep 17 00:00:00 2001 From: stan Date: Tue, 22 Nov 2005 15:11:15 +0000 Subject: [PATCH] Bug 207 - Don't display zero sized video files. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1618 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/zm_html_view_video.php | 41 ++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/web/zm_html_view_video.php b/web/zm_html_view_video.php index d5d98b67f..fe4c25e26 100644 --- a/web/zm_html_view_video.php +++ b/web/zm_html_view_video.php @@ -212,25 +212,27 @@ else $index = 0; foreach ( $video_files as $file ) { - preg_match( '/^(.+)-((?:r[_\d]+)|(?:F[_\d]+))-((?:s[_\d]+)|(?:S[0-9a-z]+))\.([^.]+)$/', $file, $matches ); - if ( preg_match( '/^r(.+)$/', $matches[2], $temp_matches ) ) + if ( filesize( $file ) > 0 ) { - $rate = (int)(100 * preg_replace( '/_/', '.', $temp_matches[1] ) ); - $rate_text = isset($rates[$rate])?$rates[$rate]:($rate."x"); - } - elseif ( preg_match( '/^F(.+)$/', $matches[2], $temp_matches ) ) - { - $rate_text = $temp_matches[1]."fps"; - } - if ( preg_match( '/^s(.+)$/', $matches[3], $temp_matches ) ) - { - $scale = (int)(100 * preg_replace( '/_/', '.', $temp_matches[1] ) ); - $scale_text = isset($scales[$scale])?$scales[$scale]:($scale."x"); - } - elseif ( preg_match( '/^S(.+)$/', $matches[3], $temp_matches ) ) - { - $scale_text = $temp_matches[1]; - } + preg_match( '/^(.+)-((?:r[_\d]+)|(?:F[_\d]+))-((?:s[_\d]+)|(?:S[0-9a-z]+))\.([^.]+)$/', $file, $matches ); + if ( preg_match( '/^r(.+)$/', $matches[2], $temp_matches ) ) + { + $rate = (int)(100 * preg_replace( '/_/', '.', $temp_matches[1] ) ); + $rate_text = isset($rates[$rate])?$rates[$rate]:($rate."x"); + } + elseif ( preg_match( '/^F(.+)$/', $matches[2], $temp_matches ) ) + { + $rate_text = $temp_matches[1]."fps"; + } + if ( preg_match( '/^s(.+)$/', $matches[3], $temp_matches ) ) + { + $scale = (int)(100 * preg_replace( '/_/', '.', $temp_matches[1] ) ); + $scale_text = isset($scales[$scale])?$scales[$scale]:($scale."x"); + } + elseif ( preg_match( '/^S(.+)$/', $matches[3], $temp_matches ) ) + { + $scale_text = $temp_matches[1]; + } ?> @@ -240,7 +242,8 @@ else  /  /