| Index: media/webm/webm_tracks_parser.cc
|
| ===================================================================
|
| --- media/webm/webm_tracks_parser.cc (revision 114032)
|
| +++ media/webm/webm_tracks_parser.cc (working copy)
|
| @@ -9,39 +9,21 @@
|
|
|
| namespace media {
|
|
|
| -static const base::TimeDelta kNoDuration =
|
| - base::TimeDelta::FromMicroseconds(-1);
|
| -
|
| WebMTracksParser::WebMTracksParser(int64 timecode_scale)
|
| : timecode_scale_(timecode_scale),
|
| track_type_(-1),
|
| track_num_(-1),
|
| track_default_duration_(-1),
|
| audio_track_num_(-1),
|
| - audio_default_duration_(kNoDuration),
|
| + audio_default_duration_(base::TimeDelta::FromMicroseconds(-1)),
|
| video_track_num_(-1),
|
| - video_default_duration_(kNoDuration) {
|
| + video_default_duration_(base::TimeDelta::FromMicroseconds(-1)) {
|
| }
|
|
|
| WebMTracksParser::~WebMTracksParser() {}
|
|
|
| int WebMTracksParser::Parse(const uint8* buf, int size) {
|
| - track_type_ =-1;
|
| - track_num_ = -1;
|
| - track_default_duration_ = -1;
|
| - audio_track_num_ = -1;
|
| - audio_default_duration_ = kNoDuration;
|
| - video_track_num_ = -1;
|
| - video_default_duration_ = kNoDuration;
|
| -
|
| - WebMListParser parser(kWebMIdTracks);
|
| - int result = parser.Parse(buf, size, this);
|
| -
|
| - if (result <= 0)
|
| - return result;
|
| -
|
| - // For now we do all or nothing parsing.
|
| - return parser.IsParsingComplete() ? result : 0;
|
| + return WebMParseListElement(buf, size, kWebMIdTracks, 1, this);
|
| }
|
|
|
|
|
| @@ -58,9 +40,9 @@
|
| bool WebMTracksParser::OnListEnd(int id) {
|
| if (id == kWebMIdTrackEntry) {
|
| if (track_type_ == -1 || track_num_ == -1) {
|
| - DVLOG(1) << "Missing TrackEntry data"
|
| - << " TrackType " << track_type_
|
| - << " TrackNum " << track_num_;
|
| + VLOG(1) << "Missing TrackEntry data"
|
| + << " TrackType " << track_type_
|
| + << " TrackNum " << track_num_;
|
| return false;
|
| }
|
|
|
| @@ -75,7 +57,7 @@
|
| audio_track_num_ = track_num_;
|
| audio_default_duration_ = default_duration;
|
| } else {
|
| - DVLOG(1) << "Unexpected TrackType " << track_type_;
|
| + VLOG(1) << "Unexpected TrackType " << track_type_;
|
| return false;
|
| }
|
|
|
| @@ -104,7 +86,7 @@
|
| }
|
|
|
| if (*dst != -1) {
|
| - DVLOG(1) << "Multiple values for id " << std::hex << id << " specified";
|
| + VLOG(1) << "Multiple values for id " << std::hex << id << " specified";
|
| return false;
|
| }
|
|
|
| @@ -113,7 +95,7 @@
|
| }
|
|
|
| bool WebMTracksParser::OnFloat(int id, double val) {
|
| - DVLOG(1) << "Unexpected float for id" << std::hex << id;
|
| + VLOG(1) << "Unexpected float for id" << std::hex << id;
|
| return false;
|
| }
|
|
|
| @@ -126,7 +108,7 @@
|
| return false;
|
|
|
| if (str != "A_VORBIS" && str != "V_VP8") {
|
| - DVLOG(1) << "Unexpected CodecID " << str;
|
| + VLOG(1) << "Unexpected CodecID " << str;
|
| return false;
|
| }
|
|
|
|
|