]> git.sesse.net Git - mlt/blobdiff - src/modules/kino/filehandler.cc
Avoid unnecessary compilation when running "./configure; make; make install" multiple...
[mlt] / src / modules / kino / filehandler.cc
index 936025c1397ae4fad2f02ca331a75ad854ce9e8f..d0915c9bb9bdbe6fe926b59dbbf4044aaa5ee1d0 100644 (file)
@@ -17,8 +17,6 @@
 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
 
-#include "config.h"
-
 extern "C" {
 #include <framework/mlt_frame.h>
 }
@@ -342,6 +340,7 @@ bool FileHandler::WriteFrame( const Frame& frame )
 RawHandler::RawHandler() : fd( -1 )
 {
        extension = ".dv";
+       numBlocks = 0;
 }
 
 
@@ -410,7 +409,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;
@@ -442,6 +442,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 ) );
 }
 
 
@@ -509,14 +510,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,