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

Unified Diff: media/filters/frame_processor_unittest.cc

Issue 294393002: MSE: Allow fully discarding frames with resulting timestamps below 0 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and fix PS4 nit (FullDiscard -> P) Created 6 years, 7 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 6061bfe97689b426f01fe89cf8b036165d40b8cf..ec0effee19b7c27adba1998cbe96a9b2236e4745 100644
--- a/media/filters/frame_processor_unittest.cc
+++ b/media/filters/frame_processor_unittest.cc
@@ -214,6 +214,12 @@ class FrameProcessorTest : public testing::TestWithParam<bool> {
last_read_buffer_->data()));
if (original_time_in_ms != time_in_ms)
ss << ":" << original_time_in_ms;
+
+ // Detect full-discard preroll buffer.
+ if (last_read_buffer_->discard_padding().first == kInfiniteDuration() &&
+ last_read_buffer_->discard_padding().second == base::TimeDelta()) {
+ ss << "P";
+ }
}
EXPECT_EQ(expected, ss.str());
@@ -567,6 +573,23 @@ TEST_P(FrameProcessorTest, AudioVideo_Discontinuity) {
}
}
+TEST_P(FrameProcessorTest,
+ AppendWindowFilterOfNegativeBufferTimestampsWithPrerollDiscard) {
+ InSequence s;
+ AddTestTracks(HAS_AUDIO);
+ new_media_segment_ = true;
+ if (GetParam())
+ frame_processor_->SetSequenceMode(true);
+
+ SetTimestampOffset(frame_duration_ * -2);
+ EXPECT_CALL(callbacks_, PossibleDurationIncrease(frame_duration_));
+ ProcessFrames("0K 10K 20K", "");
+ EXPECT_FALSE(new_media_segment_);
+ EXPECT_EQ(frame_duration_ * -2, timestamp_offset_);
+ CheckExpectedRangesByTimestamp(audio_.get(), "{ [0,10) }");
+ CheckReadsThenReadStalls(audio_.get(), "0:10P 0:20");
+}
+
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