Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(909)

Unified Diff: media/filters/frame_processor_unittest.cc

Issue 334363006: MSE: Allow negative parsed frame PTS/DTS in FrameProcessor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/frame_processor.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/frame_processor_unittest.cc
diff --git a/media/filters/frame_processor_unittest.cc b/media/filters/frame_processor_unittest.cc
index 94879fb51b00a06712f10fb85a579087cf3fa44e..b6f5d2f00fd837f01803bb60329c736a136d7792 100644
--- a/media/filters/frame_processor_unittest.cc
+++ b/media/filters/frame_processor_unittest.cc
@@ -607,6 +607,32 @@ TEST_P(FrameProcessorTest, AppendWindowFilterWithInexactPreroll) {
CheckReadsThenReadStalls(audio_.get(), "0P 0:9.75 10:20");
}
+TEST_P(FrameProcessorTest, AllowNegativeFramePTSAndDTSBeforeOffsetAdjustment) {
+ InSequence s;
+ AddTestTracks(HAS_AUDIO);
+ new_media_segment_ = true;
+ bool using_sequence_mode = GetParam();
+ if (using_sequence_mode) {
+ frame_processor_->SetSequenceMode(true);
+ EXPECT_CALL(callbacks_, PossibleDurationIncrease(frame_duration_ * 3));
+ } else {
+ EXPECT_CALL(callbacks_,
+ PossibleDurationIncrease((frame_duration_ * 5) / 2));
+ }
+
+ ProcessFrames("-5K 5K 15K", "");
+
+ if (using_sequence_mode) {
+ EXPECT_EQ(frame_duration_ / 2, timestamp_offset_);
+ CheckExpectedRangesByTimestamp(audio_.get(), "{ [0,30) }");
+ CheckReadsThenReadStalls(audio_.get(), "0:-5 10:5 20:15");
+ } else {
+ EXPECT_EQ(base::TimeDelta(), timestamp_offset_);
+ CheckExpectedRangesByTimestamp(audio_.get(), "{ [0,25) }");
+ CheckReadsThenReadStalls(audio_.get(), "0:-5 5 15");
+ }
+}
+
INSTANTIATE_TEST_CASE_P(SequenceMode, FrameProcessorTest, Values(true));
INSTANTIATE_TEST_CASE_P(SegmentsMode, FrameProcessorTest, Values(false));
« no previous file with comments | « media/filters/frame_processor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698