diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2020-06-05 18:46:40 +0200 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2020-06-05 18:46:40 +0200 |
commit | b3247252f111872574c1aa3dc993f11d8aa66282 (patch) | |
tree | a4d2fd327adf83a8a3b4d43aad8159acfd76ba94 /nihav-core/src | |
parent | 2ff5620166d8ce8b838b251d1fdd8de73f3f857c (diff) | |
download | nihav-b3247252f111872574c1aa3dc993f11d8aa66282.tar.gz |
core: make StreamManager accept NAStreamRef too
Diffstat (limited to 'nihav-core/src')
-rw-r--r-- | nihav-core/src/demuxers/mod.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nihav-core/src/demuxers/mod.rs b/nihav-core/src/demuxers/mod.rs index a0f67a8..6723cf2 100644 --- a/nihav-core/src/demuxers/mod.rs +++ b/nihav-core/src/demuxers/mod.rs @@ -94,6 +94,13 @@ impl StreamManager { self.ignored.push(false); Some(stream_num) } + /// Adds a new stream from reference-counted object. + pub fn add_stream_ref(&mut self, stream: NAStreamRef) -> Option<usize> { + let stream_num = self.streams.len(); + self.streams.push(stream); + self.ignored.push(false); + Some(stream_num) + } /// Returns stream with the requested index. pub fn get_stream(&self, idx: usize) -> Option<NAStreamRef> { if idx < self.streams.len() { |