Skip to content

armgit / ente

Public Imported from GitHub
0

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

Revert "refactor: Use separate _stopped bool instead of token state"

Prateek Sunal9ba475d9df4c
diff --git a/mobile/apps/photos/lib/services/video_preview_service.dart b/mobile/apps/photos/lib/services/video_preview_service.dart
index 191eb20ce8..2069550324 100644
--- a/mobile/apps/photos/lib/services/video_preview_service.dart
+++ b/mobile/apps/photos/lib/services/video_preview_service.dart
@@ -98,7 +98,6 @@ class VideoPreviewService {
int uploadingFileId = -1;
CancelToken? _streamingCancelToken;
int? _currentFfmpegSessionId;
- bool _stopped = false;
final Configuration config;
final ServiceLocator serviceLocator;
@@ -140,11 +139,10 @@ class VideoPreviewService {
_items.clear();
}
- bool get _isStopped => _stopped;
+ bool get _isStopped => _streamingCancelToken?.isCancelled ?? false;
/// Stop streaming immediately, cancels FFmpeg and network requests.
Future<void> stop() async {
- _stopped = true;
_streamingCancelToken?.cancel();
uploadingFileId = -1;
clearQueue();
@@ -1315,8 +1313,7 @@ class VideoPreviewService {
bool forceProcess = false,
}) {
Future.delayed(duration, () async {
- _stopped = false;
- _streamingCancelToken = null;
+ _streamingCancelToken = null; // Reset for new session
if (_hasQueuedFile && !forceProcess) return;
// Don't start streaming if file uploads are in progress