This project is read-only.

Weird crashing of VidCoder

Jul 1, 2010 at 8:42 AM

Hi there,

I am experiencing a weird problem with VidCoder on Windows 7 Enteprise (32bit). It (V0.4.3 I think... The one before 0.5.0) was working without any problem for a while, converting around 20 DVDs of mines without problem. And all of a sudden, after having prepared other Video TS folder and was ready to launch VidCoder as I did couple of minutes before, I obtained error message and blahblah. I skipped and installed the 0.5.0. Restarted the system, and tried again. I obtained this message:


System.InvalidOperationException: Sequence contains more than one matching element
   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at VidCoder.ViewModel.MainViewModel..ctor() in D:\docs\projects\VidCoder\VidCoder\ViewModel\MainViewModel.cs:line 131
   at VidCoder.App.OnStartup(StartupEventArgs e) in D:\docs\projects\VidCoder\VidCoder\app.xaml.cs:line 28
   at System.Windows.Application.<.ctor>b__1(Object unused)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)


So, that's a little bit not that much speaking for me, and the "Invalid Operation Exception" was not helping. Then I looked in the Event Log and I found these two entries:


Log Name:      Application
Source:        .NET Runtime
Date:          01/07/2010 05:38:21
Event ID:      1026
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      -
Application: VidCoder.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
   at System.Threading.ExecutionContext.runTryCode(System.Object)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
   at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(System.Object)
   at System.Windows.Application.RunInternal(System.Windows.Window)
   at System.Windows.Application.Run(System.Windows.Window)
   at VidCoder.App.Main()


and the second one:

Log Name:      Application
Source:        Application Error
Date:          01/07/2010 05:38:22
Event ID:      1000
Task Category: (100)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      -
Faulting application name: VidCoder.exe, version:, time stamp: 0x4c27e294
Faulting module name: KERNELBASE.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdaae
Exception code: 0xe0434352
Fault offset: 0x00009617
Faulting process id: 0xb10
Faulting application start time: 0x01cb18cea37c4c8f
Faulting application path: C:\Program Files\VidCoder\VidCoder.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: 18d66236-84c2-11df-9256-001636dcd833
Of course I updated the .net framework to the latest I was able to download, and VidCoder to 0.5.

It's quite weird because before that no problem. I don't recall to have made any change between the "no problem" to the "problem" times. The only thing I may have done is to switch off the WiFi on the laptop, with the hardware switch.

Jul 1, 2010 at 3:40 PM
It looks like you somehow you got in the state that it thinks more than one of your user presets is modified. I think you could fix it by going to %appdata%\VidCoder\UserPresets , then fiddling with the files in there. Only one file should be marked with <IsModified>true</IsModified>. Get rid of all but one (by deleting them or renaming them and changing IsModified to false and I'm guessing it should start working again. Not sure how you got in that state though.
Jul 2, 2010 at 3:45 AM
Edited Jul 2, 2010 at 4:05 AM

Yep, thank you it works. In fact I delete all the files in that UserPresets directory, re-installed VidCoder, and it was able to be launched and run without problem.

I noticed before deleting the presets that there were two files with their name finishing with "_modified". Is it possible that these files were let there and VidCoder was not closed properly (for any reason)? I am just thinking that maybe some changes were made in the presets, then the user (well, me ;) ) closed VidCoder without saving the changes, and that, twice for two different presets. So VidCoder  kept the files as "modified" and didn't know which one to take when I launched it again.

Another question, when uninstalling, the presets are kept, aren't they? That's why when uninstalling, then re-installing, the problem was still there.

Sorry I don't look at the source yet, and no knowledge of C# ;)

Thanks again.

Jul 2, 2010 at 4:11 AM
Edited Jul 2, 2010 at 4:14 AM
I think I know the problem here. The way it's supposed to work is that you only have one modified preset at a time. If you are on a modified preset and try to switch to another one, it prompts you to save or discard it first. The presets are saved immediately when editing them, but the last selected preset is only saved on program exit. So if you get a crash (which can happen when HandBrake crashes) and bypass saving the last selected preset, it bypasses this check and lets you get 2 modified presets, which causes problems on loading them up and processing them. I should be able to fix this in the next release. And yes, the presets are currently kept after uninstall. Thanks for reporting the problem.
Jul 10, 2010 at 11:34 PM

Alright, should be fixed in 0.5.1.

Aug 11, 2010 at 4:29 AM


Sorry for a late coming back. Yes, it works (knocking wood) flawlessly now.

Thanks again a lot!