core/frame: add a function for assigning packets to other streams
[nihav.git] / nihav-core / src / frame.rs
index 47d60850a5e0a487a725c4a0071c4c1fd7e4e10d..5b090bb942841e6006beceec1a94591c07b9389b 100644 (file)
@@ -1216,6 +1216,11 @@ impl NAPacket {
     pub fn get_buffer(&self) -> NABufferRef<Vec<u8>> { 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 {