Index: media/formats/mp4/mp4_stream_parser_unittest.cc |
diff --git a/media/formats/mp4/mp4_stream_parser_unittest.cc b/media/formats/mp4/mp4_stream_parser_unittest.cc |
index ef0bd44b3a548e5da5bf16c99b92f19a0f20d812..73f174d49283acaad26331601639a828a0ba01d8 100644 |
--- a/media/formats/mp4/mp4_stream_parser_unittest.cc |
+++ b/media/formats/mp4/mp4_stream_parser_unittest.cc |
@@ -40,6 +40,7 @@ class MP4StreamParserTest : public testing::Test { |
protected: |
scoped_ptr<MP4StreamParser> parser_; |
bool configs_received_; |
+ base::TimeDelta lower_bound_; |
bool AppendData(const uint8* data, size_t length) { |
return parser_->Parse(data, length); |
@@ -96,6 +97,25 @@ class MP4StreamParserTest : public testing::Test { |
if (!text_map.empty()) |
return false; |
+ |
wolenetz
2014/06/19 22:01:15
nit: remove extra whitespace
acolwell GONE FROM CHROMIUM
2014/06/19 23:46:47
Done.
|
+ // Find the second highest timestamp so that we know what the |
+ // timestamps on the next set of buffers must be >= than. |
+ base::TimeDelta audio = !audio_buffers.empty() ? |
+ audio_buffers.back()->GetDecodeTimestamp() : kNoTimestamp(); |
+ base::TimeDelta video = video_buffers.empty() ? |
+ video_buffers.back()->GetDecodeTimestamp() : kNoTimestamp(); |
+ base::TimeDelta second_highest_timestamp = |
+ (audio == kNoTimestamp() || |
+ (video != kNoTimestamp() && audio > video)) ? video : audio; |
+ |
+ DCHECK(second_highest_timestamp != kNoTimestamp()); |
+ |
+ if (lower_bound_ != kNoTimestamp() && |
+ second_highest_timestamp < lower_bound_) { |
+ return false; |
+ } |
+ |
+ lower_bound_ = second_highest_timestamp; |
return true; |
} |
@@ -108,6 +128,7 @@ class MP4StreamParserTest : public testing::Test { |
void NewSegmentF() { |
DVLOG(1) << "NewSegmentF"; |
+ lower_bound_ = kNoTimestamp(); |
} |
void EndOfSegmentF() { |