Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

refactor: Reorder stop() to clear queue before cancelling FFmpeg

Prateek Sunal77a6316804d4
diff --git a/mobile/apps/photos/lib/services/video_preview_service.dart b/mobile/apps/photos/lib/services/video_preview_service.dart
index fe4fa7b61b..c1522e9a5d 100644
--- a/mobile/apps/photos/lib/services/video_preview_service.dart
+++ b/mobile/apps/photos/lib/services/video_preview_service.dart
@@ -143,14 +143,15 @@ class VideoPreviewService {
/// Stop streaming immediately, cancels FFmpeg and network requests.
Future<void> stop() async {
_streamingCancelToken?.cancel();
+ uploadingFileId = -1;
+ clearQueue();
+ computeController.releaseCompute(stream: true);
+
final sessionId = _currentFfmpegSessionId;
if (sessionId != null) {
await FFmpegKit.cancel(sessionId);
_currentFfmpegSessionId = null;
}
- uploadingFileId = -1;
- clearQueue();
- computeController.releaseCompute(stream: true);
}
Future<void> stopForLogout() async {