Browse Source

修复MP4导出问题

Jimmy 2 năm trước cách đây
mục cha
commit
9008536782

+ 1 - 1
fis/Managers/FileExporterManager.cs

@@ -37,7 +37,7 @@ namespace fis.Win.Dev.Managers
         private CancellationToken _cancelToken;
         private int _fileFinishCount = 0;
         private ExportStatus _exportStatus;
-        public bool IsCancelled => _cancelTokenSource.IsCancellationRequested;
+        public bool IsCancelled => _cancelToken.IsCancellationRequested;
         public ExportStatus ExportStatus
         {
             get { return _exportStatus; }

+ 4 - 5
fis/Utilities/FFMPEG/Video/FFmpegVideoWriter.cs

@@ -82,7 +82,7 @@ namespace fis.Win.Dev.Utilities.FFMPEG.Video
         public void WriteFrame(BitmapFrame frame)
         {
             var exportManager = AppManager.Get<IFileExporterManager>();
-            if (!exportManager.IsCancelled)
+            if (exportManager.IsCancelled)
             {
                 return;
             }
@@ -96,14 +96,13 @@ namespace fis.Win.Dev.Utilities.FFMPEG.Video
             Task.Run(() =>
             {
                 try
-                {
-                    var exportManager = AppManager.Get<IFileExporterManager>();
-                    if (!exportManager.IsCancelled)
+                {                   
+                    if (exportManager.IsCancelled)
                     {
                         return;
                     }
                     _ffmpeg.StandardInput.BaseStream.Write(frame.Data, 0, frame.Data.Length);
-                    if (!exportManager.IsCancelled)
+                    if (exportManager.IsCancelled)
                     {
                         return;
                     }