freeMXF.org

Open discussion about freeMXF.org tools and MXF in general
It is currently Thu Mar 28, 2024 4:38 pm
Board index » MXF Categories » freeMXF.org Tools



Post new topic Reply to topic  [ 2 posts ] 
Author
Search for:
Message

Offline
Rookie

Joined: Mon Nov 10, 2008 7:52 pm
Posts: 1
Location: Los Angeles, CA

Post Posted: Mon Nov 10, 2008 9:41 pm 
Top  
Hi,

I'm trying to use both libraries in the same project, but sonymvd4.dll seems to interfere with mxflib.

My application crashes when it calls MXFFile::Open() which calls ReadRunIn() which calls Seek(0).

If I don't instantiate the TFileAccess class or I include the mxflib.h in a .cpp file instead of a .h file, then everything works fine.

Does anyone know anything about an incompatibility between these two libraries?

Thanks,
Paul

 Profile  

Offline
Insider

Joined: Thu Apr 15, 2004 10:39 am
Posts: 198
Location: Scotland

Post Posted: Wed Nov 19, 2008 7:36 pm 
Top  
This is a very interesting error.

This could possibly be due to an incompatibility between the different file-io systems available. By default MXFLib uses low-level I/O rather than the more normal stream I/O when compiled with Visual Studio. This is because it has support for > 4GByte files in earlier versions of the compiler.

Try adding the following section to system.h (roughly line 234) in place of the normal versions:

Code:
#ifndef MXFLIB_NO_FILE_IO
   typedef FILE *FileHandle;
   inline int FileSeek(FileHandle file, UInt64 offset) { return _fseeki64(file, offset, SEEK_SET); }
   inline int FileSeekEnd(FileHandle file) { return _fseeki64(file, 0, SEEK_END); }
   inline size_t FileRead(FileHandle file, unsigned char *dest, size_t size) { return fread(dest, 1, size, file); }
   inline size_t FileWrite(FileHandle file, const unsigned char *source, size_t size) { return fwrite(source, 1, size, file); }
   inline int FileGetc(FileHandle file) { UInt8 c; return (FileRead(file, &c, 1) == 1) ? (int)c : EOF; }
   inline FileHandle FileOpen(const char *filename) { return fopen(filename, "r+b" ); }
   inline FileHandle FileOpenRead(const char *filename) { return fopen(filename, "rb" ); }
   inline FileHandle FileOpenNew(const char *filename) { return fopen(filename, "w+b"); }
   inline bool FileValid(FileHandle file) { return (file != NULL); }
   inline bool FileEof(FileHandle file) { return feof(file) ? true : false; }
   inline UInt64 FileTell(FileHandle file) { return _ftelli64(file); }
   inline void FileClose(FileHandle file) { fclose(file); }
   inline bool FileExists(const char *filename) { struct stat buf; return stat(filename, &buf) == 0; }
#endif //MXFLIB_NO_FILE_IO

 Profile WWW  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

Jump to:  


Who is online

Users browsing this forum: No registered users and 57 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group :: Style based on FI Subice by phpBBservice.nl :: All times are UTC