rendered paste bodyIndex: mythweb/modules/stream/handler.pl
===================================================================
--- mythweb/modules/stream/handler.pl (revision 13500)
+++ mythweb/modules/stream/handler.pl (working copy)
@@ -20,12 +20,12 @@
# Shutdown cleanup, of various types
$SIG{'TERM'} = \&shutdown_handler;
+ $SIG{'PIPE'} = \&shutdown_handler;
END {
shutdown_handler();
}
sub shutdown_handler {
- kill(9, $ffmpeg_pid) if ($ffmpeg_pid);
- usleep(100000) while (wait > 0);
+ kill(1, $ffmpeg_pid) if ($ffmpeg_pid);
}
# Which show are we streaming?
@@ -129,7 +129,9 @@
}
elsif ($ENV{'REQUEST_URI'} =~ /\.flv$/i) {
# Print the movie
- $ffmpeg_pid = open(DATA, "/usr/bin/ffmpeg -y -i $filename -s 320x240 -r 24 -f flv -ac 2 -ar 11025 -ab 64k -b 256k /dev/stdout 2>/dev/null |");
+ my @ffmpeg_cmd = ('/usr/bin/ffmpeg', '-v', '-1', '-y', '-i', "$filename", '-s', '320x240', '-r', '24',
+ '-f', 'flv', '-ac', '2', '-ar', '11025', '-ab', '64k', '-b', '256k', '/dev/stdout');
+ $ffmpeg_pid = open(DATA, '-|', @ffmpeg_cmd);
unless ($ffmpeg_pid) {
print header(),
"Can't do ffmpeg: $!";