Bass.Net вызывает большую утечку памяти для тяжелых файлов.mp4
Я использую Bass.Net
в моем приложении, чтобы прочитать данные.mp4. Если я использую обычный.mp4 файл, который ограничен 700 МБ, он работает нормально. Но если он превышает предел, например, 1 ГБ, это фактически 2,30 часа данных. Я получаю исключение, и оно не позволяет мне продолжать процесс. Можете ли вы помочь мне решить эту проблему?
Прикреплен скриншот исключения и трассировки стека.
System.Reflection.TargetInvocationException was unhandled
_HResult=-2146232828
_message=Exception has been thrown by the target of an invocation.
HResult=-2146232828
IsTransient=false
Message=Exception has been thrown by the target of an invocation.
Source=mscorlib
StackTrace:
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.UnsafeInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WaveformGenerator.Program.Main() in d:\samples\WaveformGenerator_demo\WaveformGenerator\Program.cs:line 16
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.ArgumentException
_HResult=-2147024809
_message=Parameter is not valid.
HResult=-2147024809
IsTransient=false
Message=Parameter is not valid.
Source=System.Drawing
StackTrace:
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
at WaveformGenerator.WaveformGenerator.CreateHorizontalWaveformImage(WaveformDirection direction, WaveformSideOrientation sideOrientation, Int32 width, Int32 height, Single peakValue, Int32 numFullRenderFrames, Single[] leftLevelArr, Single[] rightLevelArr, Brush leftSideBrush, Brush rightSideBrush, Brush centerLineBrush)
at WaveformGenerator.WaveformGenerator.CreateWaveformImage(WaveformDirection direction, WaveformSideOrientation sideOrientation, Int32 width, Int32 height, Single peakValue, Int32 numFullRenderFrames, Single[] leftLevelArr, Single[] rightLevelArr, Brush leftSideBrush, Brush rightSideBrush, Brush centerLineBrush)
at WaveformGenerator.WaveformGenerator.CreateWaveform(Int32 width, Int32 height)
at WaveformGenerator.Form1.ReloadWaveform()
at WaveformGenerator.Form1.wg_ProgressChanged(Object sender, ProgressChangedEventArgs e)
at WaveformGenerator.WaveformGenerator.<DetectWaveformLevelsInnerAsync>b__3(ProgressChangedEventArgs value)
at System.Progress`1.InvokeHandlers(Object state)
InnerException: