-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FFME crashes silently in WPF application #637
Comments
|
I'll try it and then reply,thanks! |
I can confirm: bug exist, reproducible and pretty annoying; trick above (with providing VideoHardwareDevice) just hides the issue (especially if you update your project to NET Core 3.1, crashes become very rare) but not resolving it completely. It's a pity, FFME is a pretty useful project. |
I guess that the exception is thrown on another thread. |
@MrBean2016, actually issue isn't how to catch an exception but how to make FFME working with .NET standard stack without crashing. Same code is working perfectly on .NET Framework from 3.7 till 3.8.1 but crashes periodically on media opening on NET 5.0 - .NET Core 3.1 |
Sorry, I was a bit unclear. The purpose of catching the native exception is to find out which part of the code where the problem is. C/C++ exceptions are not compatible with .Net 5/6/7 so one must build a CLR-wrapper and catching the native exceptions in the wrapper (they wont show up in the debugger). But one thing to try is in the example in the first post to change from invoke() to begininvoke() since you may not want a thread to wait on finish execution, especially if that delegate performs I/O (which could make the delegate and your gui thread block) and the risk of deadlock since the mediaopening event will be called. |
FFME crashes silently in WPF application
I have a .Net 6.0 WPF application that uses FFME.Windows 4.4.350. Occasionally, the application exits when a call to MediaElement.Open is made.
Issue Categories
Version Information
Steps to Reproduce
Call MediaElement.Open
Several seconds later, call MediaElement.Open again
Crash
Expected Results
Second media is played.
Sample Code
XAML
C#
I am ensuring the call is being made from the main UI thread and it is wrapped in a try/catch block. However, I never catch the exception in that try/catch or even the Dispatcher.UnhandledException handler in the main application. My understanding is that for c# 5.0 and above, I should be able to catch the exception using that syntax. Any suggestions on how to catch this exception and/or find out what is going on via a log file, etc. would be greatly appreciated.
The text was updated successfully, but these errors were encountered: