]> git.nihav.org Git - nihav.git/commitdiff
core/frame: add a function for assigning packets to other streams
authorKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 27 May 2020 15:23:08 +0000 (17:23 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 27 May 2020 15:25:08 +0000 (17:25 +0200)
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 {