From: Kostya Shishkov Date: Wed, 27 May 2020 15:23:08 +0000 (+0200) Subject: core/frame: add a function for assigning packets to other streams X-Git-Url: https://git.nihav.org/?p=nihav.git;a=commitdiff_plain;h=b3785cd74e6f2ac6bdb1bda21c4c66ab807a73c0 core/frame: add a function for assigning packets to other streams --- 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 {