Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -713,9 +713,8 @@ class LinuxVideoPlayerState : VideoPlayerState {
}

override fun clearError() {
runBlocking {
withContext(Dispatchers.Main) { error = null }
}
// Snapshot state can be written from any thread; blocking on Main deadlocked when called from the UI thread.
error = null
}

override fun toggleFullscreen() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class WindowsVideoPlayerState : VideoPlayerState {
}
}

private var _error: VideoPlayerError? = null
private var _error: VideoPlayerError? by mutableStateOf(null)
override val error get() = _error

override fun clearError() {
Expand Down Expand Up @@ -498,6 +498,8 @@ class WindowsVideoPlayerState : VideoPlayerState {
mediaOperationMutex.withLock {
try {
isLoading = true
// An error from a previous source must not stick to this one.
clearError()

// Stop playback and release existing resources
val wasPlaying = _isPlaying
Expand Down