Skip to content
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

Fix #24: Require MediaSource to be Send #25

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions symphonia-core/src/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub use scoped_stream::ScopedStream;

/// A `MediaSource` is a composite trait of `std::io::Read` and `std::io::Seek`. Despite requiring
/// the `Seek` trait, seeking is an optional capability that can be queried at runtime.
pub trait MediaSource: io::Read + io::Seek {
pub trait MediaSource: io::Read + io::Seek + Send {
/// Returns if the source is seekable. This may be an expensive operation.
fn is_seekable(&self) -> bool;

Expand Down Expand Up @@ -60,7 +60,7 @@ impl MediaSource for std::fs::File {
}
}

impl<T: std::convert::AsRef<[u8]>> MediaSource for io::Cursor<T> {
impl<T: std::convert::AsRef<[u8]> + Send> MediaSource for io::Cursor<T> {
/// Always returns true since a `io::Cursor<u8>` is always seekable.
fn is_seekable(&self) -> bool {
true
Expand Down Expand Up @@ -104,7 +104,7 @@ impl<R: io::Read> ReadOnlySource<R> {
}
}

impl<R: io::Read> MediaSource for ReadOnlySource<R> {
impl<R: io::Read + Send> MediaSource for ReadOnlySource<R> {
fn is_seekable(&self) -> bool {
false
}
Expand Down Expand Up @@ -352,4 +352,4 @@ pub trait FiniteStream {

/// Returns the number of bytes available for reading.
fn bytes_available(&self) -> u64;
}
}