-
Notifications
You must be signed in to change notification settings - Fork 263
Implements Seek #513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Implements Seek #513
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
fafe4ba
seek implemented through SourceExt trait
dvdsk 023e833
request pos now uses mutable self
dvdsk 204a3f8
switch to fork for cpal
dvdsk d47842f
remove seek trait from source mods, added it to symphonia decoder, re…
dvdsk 745db82
removes SeekableSource adds failable try_seek to Source
dvdsk 202687b
adds try_seek for sink and all sources
dvdsk 1f3f36a
removes default try_seek impl, impl try_seek for decoders + refactors…
dvdsk 5b933d7
refactors seektest and adds more formats
dvdsk 961c3ef
Fix seeking for mix source
dvdsk e1092f7
refactors seek test, now covers all decoders/formats
dvdsk a3c55b8
fixes symphonia seek div by zero
dvdsk d8a8be4
add seek for lewton
dvdsk 9a4dcb0
add can_seek method to source
dvdsk eb22ec5
refactor tests, add seek beyond stream test
dvdsk ebebe88
turns SeekNotSupported into a SeekError
dvdsk 5d44bfe
fixes symphonia seek beyond end of file returning an error
dvdsk 10262f8
removes can_seek in favor of rolling back seek operations (requires P…
dvdsk 8416210
adds test verifying correct seek position after seek
dvdsk 2b39d27
adds total_duration() impl to SymphoniaDecoder, makes seek saturating…
dvdsk 5de7383
finishes doc for sink::try_seek
dvdsk f3a1966
symphonia throws error if duration is unknown and seek is beyond sour…
dvdsk 560961f
adds try_seek to spatial source
dvdsk 4237eff
revert to upstream non-seekable minimp3, comment out minimp3-seek sup…
dvdsk 3f4b530
Language and spelling fixes by @naglis
dvdsk 82bfa41
fixes seek in m4a files, fixes seeking having 1 second granularity
dvdsk d1a809f
formats everything with cargo fmt
dvdsk a24e0e6
speeds up correct_remaining_playtime test
dvdsk 724df4d
completely remove sink usage from seek tests
dvdsk b26194d
make cargo fmt happy
dvdsk 963a484
refactors symphonia try_seek
dvdsk c2c85e2
improve seek beyond end documentation
dvdsk 7357f19
remove commented out dead code in tests/seek.rs
dvdsk 8c77462
use From<f64> instead of custom `time_from_duration`
dvdsk 5dd4135
Remove duplicate doc section and fix spelling in docs
dvdsk b7b5735
Merge branch 'master' into seek_runtime_err
dvdsk 50a781a
Merge branch 'master' into seek_runtime_err
dvdsk 57f2a3c
cargo fmt
dvdsk 470eba8
Merge branch 'master' into seek_runtime_err
dvdsk 4dea149
fixes spell errors in docs and SeekError
dvdsk fb44f71
Fixes seek example and various spell/grammar issues
dvdsk 766fbbf
implement try_seek for SamplesBuffer
dvdsk c60819e
seek tests finds beep in stereo test file
dvdsk 2e9d680
(seek/test) fixes duration calc in test
dvdsk 67612b5
(seek/test) adds failing test for seeking in exausted source
dvdsk d0fce09
fix(seek) vorbis decoder crashing when seeking
dvdsk 9ae1c55
test(seek) add test for channel order
dvdsk 04c6957
test(seek) improve channel order test
dvdsk 1c82136
fix(seek) vorbis decoder now respects channel order
dvdsk 5562241
commit to save work on vorbis try_seek
dvdsk 80add81
removes seeking from vorbis decoder, can not be implemented
dvdsk 4e14b0a
Vorbis actually can be implemented since the sample rate is constant
dvdsk 3bafe32
refactor(seek) explain why seek to sample works
dvdsk 26e9db7
remove seek support for (lewton) vorbis
dvdsk 7eb13be
(tests) use rstest to refactor and expand seek test
dvdsk f846cdf
fix(seek) hound(wav) now keeps channel order consistent
dvdsk a52a41b
refactor(decoder/symphonia) logic reorderd
dvdsk 1fcf4b8
test(seek) made channel order more brittle
dvdsk 40a9447
refactor(decoder/sympthonia) use for loop instead loop + match & escape
dvdsk 6034af3
fix(decoder/symphonia) seek is no longer off
dvdsk aa0880d
seek/error symphonia seekerror is now more precise
dvdsk 7cf0451
fix(seek/delay) seek < delay duration ate up the delay
dvdsk 6f1f44f
Merge branch 'master' into seek_runtime_err
dvdsk 34366fe
style clippy fixes
dvdsk a4d167f
fix(seek) conditional compilation
dvdsk b49b22a
Merge branch 'master' into seek_runtime_err
dvdsk bbc8f00
update changelog
dvdsk 1ed1197
style, removes a needless clone()
dvdsk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use std::io::BufReader; | ||
use std::time::Duration; | ||
|
||
fn main() { | ||
let (_stream, handle) = rodio::OutputStream::try_default().unwrap(); | ||
let sink = rodio::Sink::try_new(&handle).unwrap(); | ||
|
||
let file = std::fs::File::open("assets/music.mp3").unwrap(); | ||
sink.append(rodio::Decoder::new(BufReader::new(file)).unwrap()); | ||
|
||
std::thread::sleep(std::time::Duration::from_secs(2)); | ||
sink.try_seek(Duration::from_secs(0)).unwrap(); | ||
|
||
std::thread::sleep(std::time::Duration::from_secs(2)); | ||
sink.try_seek(Duration::from_secs(4)).unwrap(); | ||
|
||
sink.sleep_until_end(); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.