Okay, so I'm running libmediainfo.so (linux) via a default copy of MediaInfoDLL.cs on mono. I feed it a file with a unicode filename. Through the debugger, I have determined that it goes through MustUseAnsi, then MediaInfoA_Open(Handle, MemoryPointer). The problem is that somewhere in there it fails.
I played around with it and this is what I gathered:
If I let it go without changing anything, it returns 0, and I don't process any more, as that means it failed to open the file.
If I remove the check that it opened and force it to continue, then about half of the files, it works with correct results. The other half, everything returns 0.
If I bypass the MustUseAnsi and open check, then it just returns 0 for everything.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Cool, thanks. Any tips for how I might debug on my own further? I can do C++ debugging, if needed. Though, I'm not sure how to debug through mono, so I'd probably just starting logging extensively.
Last edit: Thomas Baer 2019-10-20
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It is somewhere in the workflow, from conversion to/from wide chars (2-byte on Mono & 4-byte on C++ then converted to 1-char local code page for Linux, if I remember well), it is maybe in MediaInfoDLL.cpp, File_Reader.cpp, or ZenLib/File.cpp.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Okay, so I'm running libmediainfo.so (linux) via a default copy of MediaInfoDLL.cs on mono. I feed it a file with a unicode filename. Through the debugger, I have determined that it goes through MustUseAnsi, then MediaInfoA_Open(Handle, MemoryPointer). The problem is that somewhere in there it fails.
I played around with it and this is what I gathered:
If I let it go without changing anything, it returns 0, and I don't process any more, as that means it failed to open the file.
If I remove the check that it opened and force it to continue, then about half of the files, it works with correct results. The other half, everything returns 0.
If I bypass the MustUseAnsi and open check, then it just returns 0 for everything.
We didn't test especially on Mono (not used by our sponsors), we'll have a look when we have some free time.
Cool, thanks. Any tips for how I might debug on my own further? I can do C++ debugging, if needed. Though, I'm not sure how to debug through mono, so I'd probably just starting logging extensively.
Last edit: Thomas Baer 2019-10-20
It is somewhere in the workflow, from conversion to/from wide chars (2-byte on Mono & 4-byte on C++ then converted to 1-char local code page for Linux, if I remember well), it is maybe in MediaInfoDLL.cpp, File_Reader.cpp, or ZenLib/File.cpp.