diff -ur mythweb_ori/modules/stream/handler.pl mythweb/modules/stream/handler.pl --- mythweb_ori/modules/stream/handler.pl 2010-06-11 00:14:18.000000000 +0200 +++ mythweb/modules/stream/handler.pl 2010-06-10 22:50:32.000000000 +0200 @@ -2,10 +2,10 @@ # # MythWeb Streaming/Download module # -# @url $URL: http://svn.mythtv.org/svn/trunk/mythplugins/mythweb/modules/stream/handler.pl $ -# @date $Date: 2008-11-21 21:37:31 +0100 (ven 21 nov 2008) $ -# @version $Revision: 19146 $ -# @author $Author: kormoc $ +# @url $URL$ +# @date $Date$ +# @version $Revision$ +# @author $Author$ # # Necessary constants for sysopen @@ -30,7 +30,7 @@ elsif ($ENV{'REQUEST_URI'} =~ /\.flvp$/i) { require "modules/$Path[0]/stream_flvp.pl"; } - elsif ($ENV{'REQUEST_URI'} =~ /\.flv$/i) { + elsif ($ENV{'REQUEST_URI'} =~ /\.flv\?.+$/i) { require "modules/$Path[0]/stream_flv.pl"; } # Mpeg4? diff -ur mythweb_ori/modules/stream/stream_flv.pl mythweb/modules/stream/stream_flv.pl --- mythweb_ori/modules/stream/stream_flv.pl 2010-06-11 00:14:18.000000000 +0200 +++ mythweb/modules/stream/stream_flv.pl 2010-06-11 00:07:07.000000000 +0200 @@ -2,10 +2,10 @@ # # MythWeb Streaming/Download module # -# @url $URL: http://svn.mythtv.org/svn/trunk/mythplugins/mythweb/modules/stream/stream_flv.pl $ -# @date $Date: 2010-05-31 22:51:05 +0200 (lun 31 mai 2010) $ -# @version $Revision: 24931 $ -# @author $Author: kormoc $ +# @url $URL$ +# @date $Date$ +# @version $Revision$ +# @author $Author$ # use POSIX qw(ceil floor); @@ -29,7 +29,9 @@ } sub shutdown_handler { kill(1, $ffmpeg_pid) if ($ffmpeg_pid); - kill(-1, $ffmpeg_pgid) if ($ffmpeg_pid); + + # this cause an internal server error + # kill(-1, $ffmpeg_pgid) if ($ffmpeg_pid); } # Find ffmpeg @@ -72,8 +74,14 @@ $vbitrate = 256 unless ($vbitrate && $vbitrate > 1); $abitrate = 64 unless ($abitrate && $abitrate > 1); + if ("$ENV{'REQUEST_URI'}" =~ /start\=(\d+)$/i) { + $start = $1; } + else { + $start = 0; } + my $ffmpeg_command = $ffmpeg .' -y' + .' -ss '.shell_escape("$start") .' -i '.shell_escape($filename) .' -s '.shell_escape("${width}x${height}") .' -g 30' @@ -98,13 +106,16 @@ $dur = `ffmpeg -i $filename 2>&1 | grep "Duration" | cut -d ' ' -f 4 | sed s/,//`; if ($dur && $dur =~ /\d*:\d*:.*/) { @times = split(':',$dur); - $lengthSec = $times[0]*3600+$times[1]*60+$times[2]; + $lengthSec = ($times[0]*3600+$times[1]*60+$times[2])-$start; $size = int($lengthSec*($vbitrate*1000+$abitrate*1000)/8); print header(-type => 'video/x-flv','Content-Length' => $size); } else { print header(-type => 'video/x-flv'); } my $buffer; if (read DATA, $buffer, 53) { print $buffer; diff -ur mythweb_ori/modules/tv/tmpl/default/detail.php mythweb/modules/tv/tmpl/default/detail.php --- mythweb_ori/modules/tv/tmpl/default/detail.php 2010-06-11 00:14:12.000000000 +0200 +++ mythweb/modules/tv/tmpl/default/detail.php 2010-06-10 23:26:33.000000000 +0200 @@ -3,10 +3,10 @@ * This displays details about a program, as well as provides recording * commands. * - * @url $URL: http://svn.mythtv.org/svn/trunk/mythplugins/mythweb/modules/tv/tmpl/default/detail.php $ - * @date $Date: 2010-06-06 21:36:48 +0200 (dim 06 jun 2010) $ - * @version $Revision: 25007 $ - * @author $Author: kormoc $ + * @url $URL$ + * @date $Date$ + * @version $Revision$ + * @author $Author$ * @license GPL * * @package MythWeb @@ -554,7 +554,7 @@ @@ -689,7 +698,7 @@ - +