mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-14 02:04:14 +01:00
Add missing using for disposable
This commit is contained in:
parent
f22c506f46
commit
48bb95e178
1 changed files with 3 additions and 3 deletions
|
@ -39,7 +39,7 @@ public FFMpegArgumentProcessor NotifyOnProgress(Action<TimeSpan>? onTimeProgress
|
||||||
public bool ProcessSynchronously()
|
public bool ProcessSynchronously()
|
||||||
{
|
{
|
||||||
FFMpegHelper.RootExceptionCheck(FFMpegOptions.Options.RootDirectory);
|
FFMpegHelper.RootExceptionCheck(FFMpegOptions.Options.RootDirectory);
|
||||||
var instance = new Instance(FFMpegOptions.Options.FFmpegBinary, _ffMpegArguments.Text);
|
using var instance = new Instance(FFMpegOptions.Options.FFmpegBinary, _ffMpegArguments.Text);
|
||||||
instance.DataReceived += OutputData;
|
instance.DataReceived += OutputData;
|
||||||
var errorCode = -1;
|
var errorCode = -1;
|
||||||
|
|
||||||
|
@ -61,6 +61,7 @@ public async Task<bool> ProcessAsynchronously()
|
||||||
{
|
{
|
||||||
FFMpegHelper.RootExceptionCheck(FFMpegOptions.Options.RootDirectory);
|
FFMpegHelper.RootExceptionCheck(FFMpegOptions.Options.RootDirectory);
|
||||||
using var instance = new Instance(FFMpegOptions.Options.FFmpegBinary, _ffMpegArguments.Text);
|
using var instance = new Instance(FFMpegOptions.Options.FFmpegBinary, _ffMpegArguments.Text);
|
||||||
|
if (_onTimeProgress != null || (_onPercentageProgress != null && _totalTimespan != null))
|
||||||
instance.DataReceived += OutputData;
|
instance.DataReceived += OutputData;
|
||||||
var errorCode = -1;
|
var errorCode = -1;
|
||||||
|
|
||||||
|
@ -88,7 +89,6 @@ private void OutputData(object sender, (DataType Type, string Data) msg)
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
Trace.WriteLine(msg.Data);
|
Trace.WriteLine(msg.Data);
|
||||||
#endif
|
#endif
|
||||||
if (_onTimeProgress == null && (_onPercentageProgress == null || _totalTimespan == null)) return;
|
|
||||||
|
|
||||||
var match = ProgressRegex.Match(msg.Data);
|
var match = ProgressRegex.Match(msg.Data);
|
||||||
if (!match.Success) return;
|
if (!match.Success) return;
|
||||||
|
|
Loading…
Reference in a new issue