Skip to content

Commit

Permalink
keep strong ref to self
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed Jun 9, 2022
1 parent aea8f41 commit b499f36
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Tinodios/MessageCell+VLCMediaPlayerDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ extension MessageCell: VLCMediaPlayerDelegate {
if doPause {
// There is a bug in VLCPLayer: pause() is ignored if called too soon after play().
// https://code.videolan.org/videolan/VLCKit/-/issues/610
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) { [weak self] in
self?.audioPlayer?.pause()
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
// Async: audioPlayer may have been freed already.
self.audioPlayer?.pause()
}
}
self.delegate?.didSeekMedia(in: self, audioPlayer: self.audioPlayer!, pos: seekTo)
Expand Down

0 comments on commit b499f36

Please sign in to comment.