I am facing an issue with the AviManager library. I want to create an AVI file to store a video, but I keep getting an error on this line:
_aviManager = new AviManager(@"c:\\Recordings\\test.avi", false);
Looking into the library, this method looks like this:
public AviManager(String fileName, bool open){
Avi.AVIFileInit();
int result;
if(open){ //open existing file
result = Avi.AVIFileOpen(
ref aviFile, fileName,
Avi.OF_READWRITE, 0);
}else{ //create empty file
result = Avi.AVIFileOpen(
ref aviFile, fileName,
Avi.OF_WRITE | Avi.OF_CREATE, 0);
}
if(result != 0) {
throw new Exception("Exception in AVIFileOpen: "+result.ToString());
}
}
Because the file currently does not exist, it should enter the else part and create a new file. It creates the file but then it crashes because the result took the value -2147205009
. My question is, why does it do this?