fix(stream): keep recovery notifications and stop on the dispatcher
The FFmpeg ProcessFailed event arrives off-thread. Start recovery on the UI dispatcher, publish retry status there, and route StopStream back to the dispatcher before changing bound state or alert collections. This prevents a recovery exception from becoming an unhandled WPF CollectionView crash. AttentionAlertStackTests covers worker-thread recovery reporting and stop. 616 tests green, clean build with 0 warnings.
This commit is contained in:
@@ -406,6 +406,13 @@ public partial class MainViewModel : ViewModelBase
|
||||
|
||||
private async void StopStream()
|
||||
{
|
||||
var dispatcher = Application.Current?.Dispatcher;
|
||||
if (dispatcher != null && !dispatcher.CheckAccess())
|
||||
{
|
||||
_ = dispatcher.BeginInvoke(new Action(StopStream));
|
||||
return;
|
||||
}
|
||||
|
||||
CancelStreamRecovery(); // a stop wins over a relaunch in flight
|
||||
StopStepDownWatch();
|
||||
StopClipRing();
|
||||
|
||||
Reference in New Issue
Block a user