decrash
This commit is contained in:
parent
f0f69b7323
commit
d37ec6a19a
1 changed files with 4 additions and 1 deletions
|
@ -361,7 +361,10 @@ mod imp {
|
|||
match self.state.get() {
|
||||
State::Idle => 0.0,
|
||||
|
||||
State::FileLoading | State::FileEnded => self.song().unwrap().duration() as f64,
|
||||
State::FileLoading | State::FileEnded => self
|
||||
.song()
|
||||
.map(|song| song.duration() as f64)
|
||||
.unwrap_or(0.0),
|
||||
|
||||
State::FileLoaded | State::Active | State::Seeking => {
|
||||
self.mpv.get_property::<f64>("duration").unwrap()
|
||||
|
|
Loading…
Reference in a new issue