예제 #1
0
bool FrameParser::VBRHeader::Parse(BufferReader* aReader) {
  auto res = MakePair(ParseVBRI(aReader), ParseXing(aReader));
  const bool rv = (res.first().isOk() && res.first().unwrap()) ||
                  (res.second().isOk() && res.second().unwrap());
  if (rv) {
    MP3LOG(
        "VBRHeader::Parse found valid VBR/CBR header: type=%s"
        " NumAudioFrames=%u NumBytes=%u Scale=%u TOC-size=%zu",
        vbr_header::TYPE_STR[Type()], NumAudioFrames().valueOr(0),
        NumBytes().valueOr(0), Scale().valueOr(0), mTOC.size());
  }
  return rv;
}
예제 #2
0
bool
FrameParser::VBRHeader::Parse(const uint8_t* aBeg, const uint8_t* aEnd) {
  return ParseVBRI(aBeg, aEnd) || ParseXing(aBeg, aEnd);
}