From b3785cd74e6f2ac6bdb1bda21c4c66ab807a73c0 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Wed, 27 May 2020 17:23:08 +0200 Subject: [PATCH] core/frame: add a function for assigning packets to other streams --- nihav-core/src/frame.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nihav-core/src/frame.rs b/nihav-core/src/frame.rs index 47d6085..5b090bb 100644 --- a/nihav-core/src/frame.rs +++ b/nihav-core/src/frame.rs @@ -1216,6 +1216,11 @@ impl NAPacket { pub fn get_buffer(&self) -> NABufferRef> { self.buffer.clone() } /// Adds side data for a packet. pub fn add_side_data(&mut self, side_data: NASideData) { self.side_data.push(side_data); } + /// Assigns packet to a new stream. + pub fn reassign(&mut self, str: NAStreamRef, ts: NATimeInfo) { + self.stream = str; + self.ts = ts; + } } impl Drop for NAPacket { -- 2.30.2