mirror of
https://github.com/yattee/yattee.git
synced 2024-12-13 22:00:31 +05:30
Improve EOF handling with MPV
This commit is contained in:
parent
aeb7bac886
commit
cb81a687bc
@ -470,7 +470,19 @@ final class MPVBackend: PlayerBackend {
|
||||
isSeeking = true
|
||||
|
||||
case MPV_EVENT_END_FILE:
|
||||
DispatchQueue.main.async { [weak self] in self?.handleEndOfFile() }
|
||||
let reason = event!.pointee.data.load(as: mpv_end_file_reason.self)
|
||||
|
||||
if reason != MPV_END_FILE_REASON_STOP {
|
||||
DispatchQueue.main.async { [weak self] in
|
||||
guard let self else { return }
|
||||
NavigationModel.shared.presentAlert(title: "Error while opening file")
|
||||
self.model.closeCurrentItem(finished: true)
|
||||
self.getTimeUpdates()
|
||||
self.eofPlaybackModeAction()
|
||||
}
|
||||
} else {
|
||||
DispatchQueue.main.async { [weak self] in self?.handleEndOfFile() }
|
||||
}
|
||||
|
||||
default:
|
||||
logger.info(.init(stringLiteral: "UNHANDLED event: \(String(cString: mpv_event_name(event.pointee.event_id)))"))
|
||||
|
Loading…
Reference in New Issue
Block a user