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
This commit is contained in:
stan 2005-11-22 15:11:15 +00:00
parent 26694a0478
commit 3d10d019a5
1 changed files with 22 additions and 19 deletions

View File

@ -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];
}
?>
<tr>
<td class="text" align="center"><?= $matches[4] ?></td>
@ -240,7 +242,8 @@ else
<td class="text" align="center"><a href="javascript:viewVideo( '<?= $file ?>', 'zmVideo<?= $eid ?>-<?= $scale ?>', 12+<?= reScale( $event['Width'], $scale ) ?>, 20+<?= reScale( $event['Height'], $scale ) ?> );"><?= $zmSlangView ?></a>&nbsp;/&nbsp;<a href="<?= $file ?>" onClick="window.location='<?= $PHP_SELF ?>?view=<?= $view ?>&eid=<?= $eid ?>&download=<?= $index ?>'" target="_blank"><?= $zmSlangDownload ?></a>&nbsp;/&nbsp;<a href="javascript: deleteVideo( <?= $index ?> )"><?= $zmSlangDelete ?></a></td>
</tr>
<?php
$index++;
$index++;
}
}
}
}