Browse Source

Merge branch 'master' of http://git.ius.plus:88/Project-Wing/fis_lib_measure

guanxinyi 1 year ago
parent
commit
fed04fe4f8
2 changed files with 12 additions and 4 deletions
  1. 2 2
      lib/view/ai_result_modifier/controller.dart
  2. 10 2
      lib/view/player/controller.dart

+ 2 - 2
lib/view/ai_result_modifier/controller.dart

@@ -337,7 +337,7 @@ class AiResultModifierController extends GetxController {
       if (descriptions!.isEmpty) {
         continue;
       }
-      for (AIDiagnosisDescription description in descriptions!) {
+      for (AIDiagnosisDescription description in descriptions) {
         if (description.type == DiagnosisDescriptionEnum.LesionSize) {
           currLesionSize = AIDiagnosisLesionSize.fromJson(
               jsonDecode(description.value ?? ""));
@@ -942,7 +942,7 @@ class AiResultModifierController extends GetxController {
     if (descriptions!.isEmpty) {
       return;
     }
-    for (AIDiagnosisDescription description in descriptions!) {
+    for (AIDiagnosisDescription description in descriptions) {
       if (description.type == DiagnosisDescriptionEnum.LesionSize) {
         currLesionSize =
             AIDiagnosisLesionSize.fromJson(jsonDecode(description.value ?? ""));

+ 10 - 2
lib/view/player/controller.dart

@@ -289,8 +289,13 @@ class VidPlayerController extends ChangeNotifier implements IPlayerController {
         // 视频:一帧刷新时长,buffer 10ms 处理渲染
         timeout = _playAssistant!._playIntervalMillSeconds - 10;
       }
-      _frame = await _dataChannel.getImage(currentFrameIndex, timeout);
-      emitFrameUpdate();
+      final image = await _dataChannel.getImage(currentFrameIndex, timeout);
+
+      if (playing || _bufferWaiter.channel.isBufferedDone) {
+        // 未缓冲完成且暂停中 不允许 跳到下一帧
+        _frame = image;
+        emitFrameUpdate();
+      }
       return true;
     }
 
@@ -420,6 +425,9 @@ class _PlayAssistant {
 
       waiting = true;
       final result = await owner.gotoFrame(owner.currentFrameIndex + 1);
+      if (_timer == null) {
+        return; // 已取消播放
+      }
       waiting = false;
       if (result) {
         if (owner.currentFrameIndex == owner.totalFramesCount - 1) {