metadata: simplify read_nrg_chunks()
This commit is contained in:
parent
e801140625
commit
d5d83ab03e
|
@ -112,27 +112,11 @@ fn read_nrg_chunks(fd: &mut File, nm: &mut NrgMetadata) -> Result<(), NrgError>
|
||||||
let chunk_id = try!(read_nrg_chunk_id(fd));
|
let chunk_id = try!(read_nrg_chunk_id(fd));
|
||||||
match chunk_id.as_ref() {
|
match chunk_id.as_ref() {
|
||||||
"END!" => break,
|
"END!" => break,
|
||||||
"CUEX" => { nm.cuex_chunk = Some(try!(cuex::read_nrg_cuex(fd))); },
|
"CUEX" => nm.cuex_chunk = Some(try!(cuex::read_nrg_cuex(fd))),
|
||||||
"DAOX" => { nm.daox_chunk = Some(try!(daox::read_nrg_daox(fd))); },
|
"DAOX" => nm.daox_chunk = Some(try!(daox::read_nrg_daox(fd))),
|
||||||
"CDTX" => {
|
"SINF" => nm.sinf_chunk = Some(try!(sinf::read_nrg_sinf(fd))),
|
||||||
try!(skip_chunk(fd));
|
"MTYP" => nm.mtyp_chunk = Some(try!(mtyp::read_nrg_mtyp(fd))),
|
||||||
nm.skipped_chunks.push(chunk_id);
|
"CDTX" | "ETN2" | "DINF" | "TOCT" | "RELO" => {
|
||||||
},
|
|
||||||
"ETN2" => {
|
|
||||||
try!(skip_chunk(fd));
|
|
||||||
nm.skipped_chunks.push(chunk_id);
|
|
||||||
},
|
|
||||||
"SINF" => { nm.sinf_chunk = Some(try!(sinf::read_nrg_sinf(fd))); },
|
|
||||||
"MTYP" => { nm.mtyp_chunk = Some(try!(mtyp::read_nrg_mtyp(fd))); },
|
|
||||||
"DINF" => {
|
|
||||||
try!(skip_chunk(fd));
|
|
||||||
nm.skipped_chunks.push(chunk_id);
|
|
||||||
},
|
|
||||||
"TOCT" => {
|
|
||||||
try!(skip_chunk(fd));
|
|
||||||
nm.skipped_chunks.push(chunk_id);
|
|
||||||
},
|
|
||||||
"RELO" => {
|
|
||||||
try!(skip_chunk(fd));
|
try!(skip_chunk(fd));
|
||||||
nm.skipped_chunks.push(chunk_id);
|
nm.skipped_chunks.push(chunk_id);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue