From b3247252f111872574c1aa3dc993f11d8aa66282 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Fri, 5 Jun 2020 18:46:40 +0200 Subject: [PATCH] core: make StreamManager accept NAStreamRef too --- nihav-core/src/demuxers/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) 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 { + 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 { if idx < self.streams.len() { -- 2.39.5