}
rest_size -= csz;
}
- self.src.read_skip(self.movi_size)?;
- while rest_size > 0 {
- let ret = self.parse_chunk(strmgr, RIFFTag::Chunk(mktag!(b"idx1")), rest_size,0);
- if ret.is_err() { break; }
- let (csz, end) = ret.unwrap();
- if end {
- let _res = parse_idx1(&mut self.src, strmgr, seek_idx, csz, self.movi_pos);
- break;
+ if !seek_idx.skip_index {
+ self.src.read_skip(self.movi_size)?;
+ while rest_size > 0 {
+ let ret = self.parse_chunk(strmgr, RIFFTag::Chunk(mktag!(b"idx1")), rest_size,0);
+ if ret.is_err() { break; }
+ let (csz, end) = ret.unwrap();
+ if end {
+ let _res = parse_idx1(&mut self.src, strmgr, seek_idx, csz, self.movi_pos);
+ break;
+ }
+ rest_size -= csz;
}
- rest_size -= csz;
}
if self.movi_pos != 0 {
self.src.seek(SeekFrom::Start(self.movi_pos))?;
pub struct SeekIndex {
pub seek_info: Vec<StreamSeekInfo>,
pub mode: SeekIndexMode,
+ pub skip_index: bool,
}
impl SeekIndex {
}
}
pub fn seek(&mut self, time: u64) -> DemuxerResult<()> {
+ if self.seek_idx.skip_index {
+ return Err(DemuxerError::NotPossible);
+ }
self.dmx.seek(time, &self.seek_idx)
}
pub fn get_seek_index(&self) -> &SeekIndex {
else if id == mktag!(b"DATA") {
self.data_chunks.push((self.src.tell() - 10, size, ver));
}
- else if id == mktag!(b"INDX") { self.parse_index(seek_idx, (size as usize) - 10, ver)?; }
+ else if id == mktag!(b"INDX") {
+ if !seek_idx.skip_index {
+ self.parse_index(seek_idx, (size as usize) - 10, ver)?;
+ }
+ }
else if id == 0 { return Ok(true); }
else { println!("unknown chunk type {:08X}", id); }