Merge ../mlt
[melted] / src / modules / kino / riff.cc
index 51ed210..44a082c 100644 (file)
@@ -82,7 +82,9 @@
 //#include <stdio.h>
 #include <iostream>
 #include <iomanip>
+#ifndef __FreeBSD__
 #include <byteswap.h>
+#endif /* __FreeBSD__ */
 
 using std::cout;
 using std::hex;
@@ -113,7 +115,7 @@ using std::endl;
     could not get it working on the gcc compiler so I had to use this
     workaround. We can now use id = make_fourcc("ABCD") instead. */
 
-FOURCC make_fourcc( char *s )
+FOURCC make_fourcc( const char *s )
 {
        if ( s[ 0 ] == 0 )
                return 0;
@@ -513,10 +515,10 @@ void RIFFFile::ParseChunk( int parent )
 
        /* Check whether it is a LIST. If so, let ParseList deal with it */
 
-       read( fd, &type, sizeof( type ) );
+       fail_if( read( fd, &type, sizeof( type ) ) != sizeof( type ));
        if ( type == make_fourcc( "LIST" ) )
        {
-               typesize = -sizeof( type );
+               typesize = (int) -sizeof( type );
                fail_if( lseek( fd, typesize, SEEK_CUR ) == ( off_t ) - 1 );
                ParseList( parent );
        }