diff --git a/src/rsfilesrc.rs b/src/rsfilesrc.rs index 9cb744a5..01766f91 100644 --- a/src/rsfilesrc.rs +++ b/src/rsfilesrc.rs @@ -16,6 +16,9 @@ pub struct FileSrc { position: u64, } +unsafe impl Sync for FileSrc {} +unsafe impl Send for FileSrc {} + impl FileSrc { fn new() -> FileSrc { FileSrc { location: None, file: None, position: 0 } diff --git a/src/rshttpsrc.rs b/src/rshttpsrc.rs index 3b2add3d..332ef76b 100644 --- a/src/rshttpsrc.rs +++ b/src/rshttpsrc.rs @@ -22,6 +22,9 @@ pub struct HttpSrc { stop: u64, } +unsafe impl Sync for HttpSrc {} +unsafe impl Send for HttpSrc {} + impl HttpSrc { fn new() -> HttpSrc { HttpSrc { url: None, client: Client::new(), response: None, seekable: false, position: 0, size: u64::MAX, start: 0, stop: u64::MAX } diff --git a/src/rssource.rs b/src/rssource.rs index 1aac363e..a6bcbbe0 100644 --- a/src/rssource.rs +++ b/src/rssource.rs @@ -5,7 +5,7 @@ use std::ptr; use utils::*; -pub trait Source { +pub trait Source: Sync + Send { fn set_uri(&mut self, uri_str: &Option) -> bool; fn get_uri(&self) -> Option; fn is_seekable(&self) -> bool;