robvdpol / RaceControl

Race Control is a standalone, open source F1TV client for Windows, written in C# on the .NET platform.
GNU General Public License v3.0
1.19k stars 95 forks source link

[BUG] Video Player crash when you unpause all after syncing #161

Closed wolfsburg13 closed 3 years ago

wolfsburg13 commented 3 years ago

edit: I may have found a fix? I took the latest version of flyleaf from their git, extracted the DLLs from libs/x64/FFmpeg to Race Control/ffmpeg and then registered all DLLs just to be safe. I am now able to pause all, sync all, unpause all and it works fine, hasn't crashed a single time yet. I also extracted all files in the Flyleaf/libs folder to root race control folder. I had to revert FlyLeafLib.dll because it was actually a lower version (3.1.0.0 vs 3.1.8.0 in RC pkg), but left everything else. Not sure if its just a coincidence but I work as QA irl so thought I would mention 👍

Describe the bug Happens with live AND old sessions. When you have multiple streams open, pausing all (shift+spacebar), syncing and then trying to unpause all makes all video players instantly freeze and eventually crash. After the crash some windows get automatically re-opened.

To Reproduce Steps to reproduce the behavior:

  1. Have multiple streams from same event
  2. Sync to main stream
  3. Pause all
  4. Sync to main stream
  5. Unpause all --> FREEZE

Expected behavior All video players unpause at sync time

Windows 10 64bit, using internal video player and latest RC build.

F1TV account Pro subscription. Accessing from Canada, no VPN.

Additional context Sometimes a few videos will unpause but 1 will get stuck, and then trying to unpause that produces same issue. But more regularly it happens as I described at top of post.

This is log from the crash:

2021-06-19 07:37:59.6335 INFO Toggling pause... 2021-06-19 07:38:05.4329 INFO Syncing streams with sync-UID '1000003935' to timestamp '17140700000'... 2021-06-19 07:38:06.9527 INFO Toggling pause for all video players... 2021-06-19 07:38:06.9527 INFO Toggling pause... 2021-06-19 07:38:38.8332 INFO Refreshing live sessions... 2021-06-19 07:38:38.8332 INFO Querying live sessions... 2021-06-19 07:38:39.0663 ERROR An unhandled exception occurred. System.PlatformNotSupportedException: Thread abort is not supported on this platform. at System.Threading.Thread.Abort() at FlyleafLib.Utils.EnsureThreadDone(Thread t, Int64 maxMS, Int32 minMS) at FlyleafLib.MediaPlayer.Player.Play() at RaceControl.Flyleaf.FlyleafMediaPlayer.TogglePause() in D:\Projects\RaceControl\RaceControl\RaceControl\Flyleaf\FlyleafMediaPlayer.cs:line 217 at RaceControl.ViewModels.VideoDialogViewModel.TogglePauseExecute() in D:\Projects\RaceControl\RaceControl\RaceControl\ViewModels\VideoDialogViewModel.cs:line 272 at RaceControl.Extensions.CommandExtensions.TryExecute(ICommand command, Object parameter) in D:\Projects\RaceControl\RaceControl\RaceControl\Extensions\CommandExtensions.cs:line 11 at RaceControl.ViewModels.VideoDialogViewModel.OnPauseAll() in D:\Projects\RaceControl\RaceControl\RaceControl\ViewModels\VideoDialogViewModel.cs:line 323 at Prism.Events.EventSubscription.InvokeAction(Action action) at Prism.Events.EventSubscription.<>c__DisplayClass8_0.b__0(Object[] arguments) at Prism.Events.EventBase.InternalPublish(Object[] arguments) at Prism.Events.PubSubEvent.Publish() at RaceControl.ViewModels.VideoDialogViewModel.TogglePauseAllExecute() in D:\Projects\RaceControl\RaceControl\RaceControl\ViewModels\VideoDialogViewModel.cs:line 278 at System.Windows.Input.CommandManager.TranslateInput(IInputElement targetElement, InputEventArgs inputEventArgs) at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled) at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers) at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) 2021-06-19 07:38:39.1353 INFO Getting tokenised URL for content-type 'Channel' and content-URL 'CONTENT/PLAY?channelId=1009&contentId=1000003935'...

robvdpol commented 3 years ago

I'll look into it, thanks for your efforts so far.

robvdpol commented 3 years ago

I had a difficult time reproducing this, so I simply upgraded the FFmpeg binaries to the ones that come with Flyleaf.

Please let me know whether this has fixed it (next release should be out this week).