Skip to content

Commit

Permalink
fix(playback): set progress after open
Browse files Browse the repository at this point in the history
  • Loading branch information
Yesterday17 committed Sep 16, 2024
1 parent c5842a7 commit 0edc10c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion anni-playback/src/decoder/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,13 @@ impl Decoder {
None => (),
Some(message) => match message {
InternalPlayerEvent::Open(source, buffer_signal) => {
let playback = Self::open(source, buffer_signal)?;
self.controls.set_progress(ProgressState {
position: 0,
duration: playback.duration,
});
self.cpal_output = None;
self.playback = Some(Self::open(source, buffer_signal)?);
self.playback = Some(playback);
}
InternalPlayerEvent::Play => {
self.state = DecoderState::Playing;
Expand Down

0 comments on commit 0edc10c

Please sign in to comment.