+ fixes for opendml dv avi
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 25 Jul 2005 07:21:39 +0000 (07:21 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 25 Jul 2005 07:21:39 +0000 (07:21 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@782 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/kino/avi.cc
src/modules/kino/avi.h
src/modules/kino/riff.cc
src/modules/kino/riff.h

index 2ee0c99..96e2b54 100644 (file)
@@ -21,6 +21,9 @@
 * Change log:
 * 
 * $Log$
+* Revision 1.3  2005/07/25 07:21:39  lilo_booter
+* + fixes for opendml dv avi
+*
 * Revision 1.2  2005/06/21 20:59:39  lilo_booter
 * src/framework/mlt_consumer.c src/framework/mlt_consumer.h
 * + Added a general profile handling for size, aspect ratio and display ratio
@@ -943,7 +946,7 @@ void AVIFile::ParseRIFF()
 
        avih_chunk = FindDirectoryEntry( make_fourcc( "avih" ) );
        if ( avih_chunk != -1 )
-               ReadChunk( avih_chunk, ( void* ) & mainHdr );
+               ReadChunk( avih_chunk, ( void* ) & mainHdr, sizeof( MainAVIHeader ) );
 }
 
 
@@ -952,7 +955,7 @@ void AVIFile::ReadIndex()
        indx_chunk[ 0 ] = FindDirectoryEntry( make_fourcc( "indx" ) );
        if ( indx_chunk[ 0 ] != -1 )
        {
-               ReadChunk( indx_chunk[ 0 ], ( void* ) indx[ 0 ] );
+               ReadChunk( indx_chunk[ 0 ], ( void* ) indx[ 0 ], sizeof( AVISuperIndex ) );
                index_type = AVI_LARGE_INDEX;
 
                /* recalc number of frames from each index */
@@ -966,7 +969,7 @@ void AVIFile::ReadIndex()
        idx1_chunk = FindDirectoryEntry( make_fourcc( "idx1" ) );
        if ( idx1_chunk != -1 )
        {
-               ReadChunk( idx1_chunk, ( void* ) idx1 );
+               ReadChunk( idx1_chunk, ( void* ) idx1, sizeof( AVISuperIndex ) );
                idx1->nEntriesInUse = GetDirectoryEntry( idx1_chunk ).length / 16;
                index_type = AVI_SMALL_INDEX;
 
@@ -1101,14 +1104,14 @@ bool AVIFile::verifyStreamFormat( FOURCC type )
 
        while ( ( i = FindDirectoryEntry( strh, j++ ) ) != -1 )
        {
-               ReadChunk( i, ( void* ) & avi_stream_header );
+               ReadChunk( i, ( void* ) & avi_stream_header, sizeof( AVIStreamHeader ) );
                if ( avi_stream_header.fccHandler == type )
                        return true;
        }
        j = 0;
        while ( ( i = FindDirectoryEntry( strf, j++ ) ) != -1 )
        {
-               ReadChunk( i, ( void* ) & bih );
+               ReadChunk( i, ( void* ) & bih, sizeof( BITMAPINFOHEADER ) );
                if ( ( FOURCC ) bih.biCompression == type )
                        return true;
        }
@@ -1124,7 +1127,7 @@ bool AVIFile::verifyStream( FOURCC type )
 
        while ( ( i = FindDirectoryEntry( strh, j++ ) ) != -1 )
        {
-               ReadChunk( i, ( void* ) & avi_stream_header );
+               ReadChunk( i, ( void* ) & avi_stream_header, sizeof( AVIStreamHeader ) );
                if ( avi_stream_header.fccType == type )
                        return true;
        }
@@ -1818,7 +1821,7 @@ void AVIFile::setFccHandler( FOURCC type, FOURCC handler )
 
                        while ( ( k = FindDirectoryEntry( strf, j++ ) ) != -1 )
                        {
-                               ReadChunk( k, ( void* ) & bih );
+                               ReadChunk( k, ( void* ) & bih, sizeof( BITMAPINFOHEADER ) );
                                bih.biCompression = handler;
                        }
                }
@@ -1835,7 +1838,7 @@ bool AVIFile::getStreamFormat( void* data, FOURCC type )
 
        while ( ( result == false ) && ( i = FindDirectoryEntry( strh, j++ ) ) != -1 )
        {
-               ReadChunk( i, ( void* ) & avi_stream_header );
+               ReadChunk( i, ( void* ) & avi_stream_header, sizeof( AVIStreamHeader ) );
                if ( avi_stream_header.fccType == type )
                {
                        FOURCC chunkID;
index 68f2ea4..d22d5e6 100644 (file)
@@ -21,6 +21,9 @@
 * Change log:
 * 
 * $Log$
+* Revision 1.4  2005/07/25 07:21:39  lilo_booter
+* + fixes for opendml dv avi
+*
 * Revision 1.3  2005/06/21 20:59:39  lilo_booter
 * src/framework/mlt_consumer.c src/framework/mlt_consumer.h
 * + Added a general profile handling for size, aspect ratio and display ratio
@@ -240,6 +243,7 @@ typedef struct
        LONG biYPelsPerMeter;
        DWORD biClrUsed;
        DWORD biClrImportant;
+       char dummy[ 1040 ];
 }
 PACKED(BITMAPINFOHEADER);
 
@@ -270,7 +274,7 @@ typedef struct
                DWORD dwSize;
                DWORD dwDuration;
        }
-       aIndex[ 2014 ];
+       aIndex[ 3198 ];
 }
 PACKED(AVISuperIndex);
 
@@ -288,7 +292,7 @@ typedef struct
                DWORD dwOffset;
                DWORD dwSize;
        }
-       aIndex[ 4028 ];
+       aIndex[ 17895 ];
 }
 PACKED(AVIStdIndex);
 
index bc616dd..46d7866 100644 (file)
@@ -21,6 +21,9 @@
 * Change log:
 * 
 * $Log$
+* Revision 1.2  2005/07/25 07:21:39  lilo_booter
+* + fixes for opendml dv avi
+*
 * Revision 1.1  2005/04/15 14:28:26  lilo_booter
 * Initial version
 *
@@ -612,14 +615,14 @@ void RIFFFile::ParseRIFF( void )
  
 */
 
-void RIFFFile::ReadChunk( int chunk_index, void *data )
+void RIFFFile::ReadChunk( int chunk_index, void *data, off_t data_len )
 {
        RIFFDirEntry entry;
 
        entry = GetDirectoryEntry( chunk_index );
        pthread_mutex_lock( &file_mutex );
        fail_if( lseek( fd, entry.offset, SEEK_SET ) == ( off_t ) - 1 );
-       fail_neg( read( fd, data, entry.length ) );
+       fail_neg( read( fd, data, data_len ) );
        pthread_mutex_unlock( &file_mutex );
 }
 
index e7a2146..c9f3d1e 100644 (file)
@@ -21,6 +21,9 @@
 * Change log:
 * 
 * $Log$
+* Revision 1.2  2005/07/25 07:21:39  lilo_booter
+* + fixes for opendml dv avi
+*
 * Revision 1.1  2005/04/15 14:28:26  lilo_booter
 * Initial version
 *
@@ -126,7 +129,7 @@ public:
        virtual void ParseChunk( int parent );
        virtual void ParseList( int parent );
        virtual void ParseRIFF( void );
-       virtual void ReadChunk( int chunk_index, void *data );
+       virtual void ReadChunk( int chunk_index, void *data, off_t data_len );
        virtual void WriteChunk( int chunk_index, const void *data );
        virtual void WriteRIFF( void );