Commit db28788c authored by Sergey Volk's avatar Sergey Volk Committed by Commit Bot

[Chromecast] Fix timestamp checks in CMA unit tests

CMA backends might choose to implement GetCurrentPts in such a way that
it reports the current position to be kStartPts immediately after
Start(kStartPts) is called, rather then after playback actually starts,
and that should be ok.

Bug: none
Test: cast_media_unittests
Change-Id: I4e232504c0a664fb0e715eed96982c2a6d62b2e2
Reviewed-on: https://chromium-review.googlesource.com/775873Reviewed-by: default avatarLuke Halliwell <halliwell@chromium.org>
Commit-Queue: Sergey Volk <servolk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517493}
parent 64565fd7
...@@ -795,12 +795,14 @@ void AudioVideoPipelineDeviceTest::MonitorLoop() { ...@@ -795,12 +795,14 @@ void AudioVideoPipelineDeviceTest::MonitorLoop() {
if (audio_feeder_ && if (audio_feeder_ &&
audio_feeder_->last_pushed_pts() != audio_feeder_->last_pushed_pts() !=
std::numeric_limits<int64_t>::min()) { std::numeric_limits<int64_t>::min()) {
EXPECT_LE(pts, audio_feeder_->last_pushed_pts() + 100 * 1000); EXPECT_LE(pts, std::max(kStartPts,
audio_feeder_->last_pushed_pts() + 100 * 1000));
} }
if (video_feeder_ && if (video_feeder_ &&
video_feeder_->last_pushed_pts() != video_feeder_->last_pushed_pts() !=
std::numeric_limits<int64_t>::min()) { std::numeric_limits<int64_t>::min()) {
EXPECT_LE(pts, video_feeder_->last_pushed_pts() + 100 * 1000); EXPECT_LE(pts, std::max(kStartPts,
video_feeder_->last_pushed_pts() + 100 * 1000));
} }
// PTS is allowed to move backwards once to allow for updates when the first // PTS is allowed to move backwards once to allow for updates when the first
// buffers are pushed. // buffers are pushed.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment