From 7db02dea5a670f279927554ded978a5c03b29a90 Mon Sep 17 00:00:00 2001 From: stan Date: Tue, 22 Nov 2005 15:12:59 +0000 Subject: [PATCH] Bug 207 - Fall back in xHTML to default video format if phone format no specified git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1619 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/zm_xhtml_view_video.php | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/web/zm_xhtml_view_video.php b/web/zm_xhtml_view_video.php index f42765ac1..5855fbc1d 100644 --- a/web/zm_xhtml_view_video.php +++ b/web/zm_xhtml_view_video.php @@ -71,13 +71,26 @@ foreach ( $ffmpeg_formats as $ffmpeg_format ) { preg_match( '/^([^*]+)(\**)$/', $ffmpeg_format, $matches ); $video_formats[$matches[1]] = $matches[1]; - if ( $matches[2] == '**' ) + if ( $matches[2] == '*' ) { - if ( !isset($video_format) ) - { - $video_format = $matches[1]; - } + $default_video_format = $matches[1]; } + elseif ( $matches[2] == '**' ) + { + $default_phone_format = $matches[1]; + } +} +if ( isset($default_phone_format) ) +{ + $video_format = $default_phone_format; +} +elseif ( isset($default_video_format) ) +{ + $video_format = $default_video_format; +} +else +{ + $video_format = $ffmpeg_formats[0]; } if ( !empty($generate) )