From 36f9feb3ff75623a28ffaee5ad960be312c238a6 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Mon, 18 Nov 2024 13:16:16 +0800 Subject: [PATCH] fix: danmaku duration fix https://github.com/guozhigq/pilipala/issues/716 Signed-off-by: bggRGjQaUbCoE --- lib/plugin/pl_player/controller.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index d004b323..1edb03eb 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -862,9 +862,12 @@ class PlPlayerController { try { DanmakuOption currentOption = danmakuController!.option; defaultDuration ??= currentOption.duration; - DanmakuOption updatedOption = currentOption.copyWith( - duration: (defaultDuration! / speed) * playbackSpeed); + DanmakuOption updatedOption = + currentOption.copyWith(duration: defaultDuration! / speed); danmakuController!.updateOption(updatedOption); + if (speed == 1.0) { + defaultDuration = null; + } } catch (_) {} // fix 长按倍速后放开不恢复 if (!doubleSpeedStatus.value) {