From a7c4d3f3e9cdf79a2492bebbd23a462c6cbe72a4 Mon Sep 17 00:00:00 2001 From: Chris Wiggins Date: Sun, 22 Sep 2013 10:40:54 +1200 Subject: [PATCH] Accidental copy of old logic. Fixed --- src/zm_ffmpeg_camera.cpp | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index 0911c32c1..929423aac 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -266,30 +266,6 @@ int FfmpegCamera::CaptureAndRecord( Image &image, bool recording, char* event_di AVPacket packet; uint8_t* directbuffer; - //Warning("Recording: %d", (int)recording); - - if(recording && !wasRecording){ - //Instanciate the video storage module - char fileName[4096]; - snprintf(fileName, sizeof(fileName), "%s/event.mkv", event_directory); - videoStore = new VideoStore((const char *)fileName, "matroska", mFormatContext->streams[mVideoStreamId]); - wasRecording = true; - strcpy(oldDirectory, event_directory); - - }else if(!recording && wasRecording){ - Warning("Deleting videoStore instance"); - delete videoStore; - } - - //The directory we are recording to is no longer tied to the current event. Need to re-init the videostore with the correct directory and start recording again - if(recording && wasRecording && (strcmp(oldDirectory, event_directory)!=0) ){ - delete videoStore; - char fileName[4096]; - snprintf(fileName, sizeof(fileName), "%s/event.mkv", event_directory); - videoStore = new VideoStore((const char *)fileName, "matroska", mFormatContext->streams[mVideoStreamId]); - strcpy(oldDirectory, event_directory); - } - /* Request a writeable buffer of the target image */ directbuffer = image.WriteBuffer(width, height, colours, subpixelorder); if(directbuffer == NULL) { @@ -319,11 +295,9 @@ int FfmpegCamera::CaptureAndRecord( Image &image, bool recording, char* event_di Debug( 3, "Got frame %d", frameCount ); avpicture_fill( (AVPicture *)mFrame, directbuffer, imagePixFormat, width, height); - - - - - + + + //Video recording if(recording && !wasRecording){ //Instanciate the video storage module char fileName[4096];