From e24794ee1808504fd9d2083f5c725bdb8a19fd38 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Wed, 10 May 2017 19:05:43 +0200 Subject: [PATCH] use peek in GDV demuxer --- src/demuxers/gdv.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/demuxers/gdv.rs b/src/demuxers/gdv.rs index c556197..6055938 100644 --- a/src/demuxers/gdv.rs +++ b/src/demuxers/gdv.rs @@ -1,7 +1,6 @@ use super::*; use io::byteio::*; use frame::*; -use std::io::SeekFrom; //use std::collections::HashMap; enum GDVState { @@ -123,9 +122,8 @@ pktdta: Vec::new(), let magic = src.read_u16be()?; if magic != 0x0513 { return Err(DemuxerError::InvalidData); } let size = (src.read_u16le()? as usize) + 4; - let tmp = src.read_u32le()?; + let tmp = src.peek_u32le()?; let flags = (tmp & 0xFF) as usize; - src.seek(SeekFrom::Current(-4))?; self.state = GDVState::NewFrame; self.cur_frame = self.cur_frame + 1; src.read_packet(str, Some((self.cur_frame - 1) as u64), None, None, if (flags & 64) != 0 { true } else { false }, size) -- 2.39.5