diff -Naur libmp4v2.orig/libplatform/io/File_win32.cpp libmp4v2/libplatform/io/File_win32.cpp --- libmp4v2.orig/libplatform/io/File_win32.cpp 2008-11-16 02:50:26.000000000 -0500 +++ libmp4v2/libplatform/io/File_win32.cpp 2009-03-13 02:00:09.000000000 -0400 @@ -8,7 +8,8 @@ bool StdioFile::getPosition( Size& pos_ ) { - pos_ = _ftelli64( _handle ); + fflush( _handle ); // must flush because we're using _fileno routines + pos_ = _telli64( _fileno( _handle )); return pos_ == -1; } @@ -17,6 +18,7 @@ bool StdioFile::getSize( Size& size_ ) { + fflush( _handle ); // must flush because we're using _fileno routines LARGE_INTEGER n; if( !GetFileSizeEx( (HANDLE)_get_osfhandle( _fileno( _handle )), &n )) return true; @@ -29,7 +31,8 @@ bool StdioFile::setPosition( Size pos_ ) { - return _fseeki64( _handle, pos_, SEEK_SET ) != 0; + fflush( _handle ); // must flush because we're using _fileno routines + return _lseeki64( _fileno( _handle ), pos_, SEEK_SET ) == -1; } ///////////////////////////////////////////////////////////////////////////////