X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmodules%2Fkino%2Ffilehandler.cc;h=697c7e6c15a780b41f7e0882b45eb5cdd57bccf7;hb=3b15124f067760e2fd16c1223d2f2c1ebfd80c22;hp=e5e552cc52739cbf47d515c8b1997d601598fd0e;hpb=d5fa53ca96e2cf875f7de0890292d9db2abbda80;p=mlt diff --git a/src/modules/kino/filehandler.cc b/src/modules/kino/filehandler.cc index e5e552cc..697c7e6c 100644 --- a/src/modules/kino/filehandler.cc +++ b/src/modules/kino/filehandler.cc @@ -23,7 +23,7 @@ extern "C" { #include } -#include +#include #include #include #include @@ -117,6 +117,10 @@ FileHandler::FileHandler() : done( false ), autoSplit( false ), maxFrameCount( 9 framesWritten( 0 ), filename( "" ) { /* empty body */ + timeStamp = 0; + everyNthFrame = 0; + framesToSkip = 0; + maxFileSize = 0; } @@ -338,6 +342,7 @@ bool FileHandler::WriteFrame( const Frame& frame ) RawHandler::RawHandler() : fd( -1 ) { extension = ".dv"; + numBlocks = 0; } @@ -406,7 +411,8 @@ bool RawHandler::Open( const char *s ) return false; if ( read( fd, data, 4 ) < 0 ) return false; - lseek( fd, 0, SEEK_SET ); + if ( lseek( fd, 0, SEEK_SET ) < 0 ) + return false; numBlocks = ( ( data[ 3 ] & 0x80 ) == 0 ) ? 250 : 300; filename = s; return true; @@ -438,6 +444,7 @@ AVIHandler::AVIHandler( int format ) : avi( NULL ), aviFormat( format ), isOpenD extension = ".avi"; for ( int c = 0; c < 4; c++ ) audioChannels[ c ] = NULL; + memset( &dvinfo, 0, sizeof( dvinfo ) ); } @@ -505,14 +512,14 @@ bool AVIHandler::Create( const string& filename ) case AVI_DV1_FORMAT: fail_null( avi = new AVI1File ); - if ( avi->Create( filename.c_str() ) == false ) + if ( !avi || avi->Create( filename.c_str() ) == false ) return false; //avi->Init( videoInfo.isPAL ? AVI_PAL : AVI_NTSC, audioInfo.frequency, AVI_LARGE_INDEX ); break; case AVI_DV2_FORMAT: fail_null( avi = new AVI2File ); - if ( avi->Create( filename.c_str() ) == false ) + if ( !avi || avi->Create( filename.c_str() ) == false ) return false; //if ( GetOpenDML() ) //avi->Init( videoInfo.isPAL ? AVI_PAL : AVI_NTSC, audioInfo.frequency,