From 8a710e3a89177c7447042cad850b09e2dcdfe0e1 Mon Sep 17 00:00:00 2001 From: stan Date: Thu, 23 Jun 2005 08:40:43 +0000 Subject: [PATCH] Bug 110 - Moved frame boundaries before frames. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1479 e3e1d417-86f3-4887-817a-d78f3d33393f --- src/zm_event.cpp | 6 +++--- src/zm_monitor.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/zm_event.cpp b/src/zm_event.cpp index 30753bd75..4f5be7784 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -448,7 +448,6 @@ void Event::StreamEvent( int event_id, int scale, int rate, int maxfps ) } fprintf( stdout, "Content-Type: multipart/x-mixed-replace;boundary=ZoneMinderFrame\r\n\r\n" ); - fprintf( stdout, "--ZoneMinderFrame\r\n" ); FILE *fdj = NULL; int n_bytes = 0; @@ -500,10 +499,11 @@ void Event::StreamEvent( int event_id, int scale, int rate, int maxfps ) image.EncodeJpeg( buffer, &n_bytes ); } + fprintf( stdout, "--ZoneMinderFrame\r\n" ); fprintf( stdout, "Content-Length: %d\r\n", n_bytes ); fprintf( stdout, "Content-Type: image/jpeg\r\n\r\n" ); - write( fileno(stdout), buffer, n_bytes ); - fprintf( stdout, "\r\n\r\n--ZoneMinderFrame\r\n" ); + fwrite( buffer, n_bytes, 1, stdout ); + fprintf( stdout, "\r\n\r\n" ); fflush( stdout ); last_delta = this_delta; db_written = true; diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index f1d288c77..398a4b6bd 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -1265,7 +1265,6 @@ Monitor *Monitor::Load( int id, bool load_zones, Purpose purpose ) void Monitor::StreamImages( int scale, int maxfps, time_t ttl ) { fprintf( stdout, "Content-Type: multipart/x-mixed-replace;boundary=ZoneMinderFrame\r\n\r\n" ); - fprintf( stdout, "--ZoneMinderFrame\r\n" ); int fps = int(GetFPS()); if ( !fps ) @@ -1328,10 +1327,11 @@ void Monitor::StreamImages( int scale, int maxfps, time_t ttl ) } snap_image->EncodeJpeg( img_buffer, &img_buffer_size ); + fprintf( stdout, "--ZoneMinderFrame\r\n" ); fprintf( stdout, "Content-Length: %d\r\n", img_buffer_size ); fprintf( stdout, "Content-Type: image/jpeg\r\n\r\n" ); fwrite( img_buffer, img_buffer_size, 1, stdout ); - fprintf( stdout, "\r\n\r\n--ZoneMinderFrame\r\n" ); + fprintf( stdout, "\r\n\r\n" ); if ( ttl ) {