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

Issue 9582017: Change Clock::SetMaxTime() to be safe even in the presence of slow pipelines. (Closed)

Created:
8 years, 9 months ago by Ami GONE FROM CHROMIUM
Modified:
8 years, 9 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, acolwell GONE FROM CHROMIUM
Visibility:
Public.

Description

Change Clock::SetMaxTime() to be safe even in the presence of slow pipelines. Before this CL the contract of SetMaxTime was unsatisfiable; a clock client could check that the max_time it was about to set wasn't greater than Elapsed() before calling SetMaxTime(), but between the time that check was done and the DCHECK inside SetMaxTime, time could move forward! After this CL, SetMaxTime() is allowed to move the media_time_ backward and set the underflow_ bit if the pipeline is slow enough. BUG=113037, chromium-os:26939 TEST=A Debug binary on an underpowered ARM crosbook with no audio device plays back correctly. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=124739

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -5 lines) Patch
M media/base/clock.h View 1 chunk +1 line, -2 lines 0 comments Download
M media/base/clock.cc View 1 chunk +3 lines, -2 lines 1 comment Download
M media/base/pipeline.cc View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
Ami GONE FROM CHROMIUM
8 years, 9 months ago (2012-03-02 18:33:00 UTC) #1
Ami GONE FROM CHROMIUM
vrk: after I sent out this CL Dale pointed out to me bug 113037 (that ...
8 years, 9 months ago (2012-03-02 18:38:43 UTC) #2
scherkus (not reviewing)
rubber stamp lgtm w/ following FYI: there are some SetMaxTime() tests in clock_unittests.cc -- update/fix/etc?
8 years, 9 months ago (2012-03-02 19:09:28 UTC) #3
Ami GONE FROM CHROMIUM
> there are some SetMaxTime() tests in clock_unittests.cc -- update/fix/etc? They already pass (not surprising, ...
8 years, 9 months ago (2012-03-02 19:11:02 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fischman@chromium.org/9582017/1
8 years, 9 months ago (2012-03-02 19:11:12 UTC) #5
commit-bot: I haz the power
Change committed as 124739
8 years, 9 months ago (2012-03-02 21:49:52 UTC) #6
vrk (LEFT CHROMIUM)
8 years, 9 months ago (2012-03-05 22:18:08 UTC) #7
LGTM

Thanks for fixing! There is still a minor bug (see comment in clock.cc), but I
think this is a good simple CL to fix 99% of the problem.

acolwell: Can you read the comment and crbug.com/116856 to confirm my
understanding of the situation?

http://codereview.chromium.org/9582017/diff/1/media/base/clock.cc
File media/base/clock.cc (right):

http://codereview.chromium.org/9582017/diff/1/media/base/clock.cc#newcode77
media/base/clock.cc:77: media_time_ = max_time_;
Technically this assignment is incorrect: you want to set |media_time_| to the
current time, not the max time. However, the effect of this is very minor since
max time is only a few frames ahead of the current time, and because of the way
the video renderer works, I believe everything works out fine for every
subsequent call to SetMaxTime().

I filed crbug.com/116856. As I say in the bug, I think it should still be fixed
for code sanity purposes, despite the low-impact.

Powered by Google App Engine
This is Rietveld 408576698