Accidental copy of old logic. Fixed

This commit is contained in:
Chris Wiggins 2013-09-22 10:40:54 +12:00
parent 6a7b38dac6
commit a7c4d3f3e9
1 changed files with 3 additions and 29 deletions

View File

@ -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];