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

Issue 2782004: Added checks to GetBufferedTime() to cap at the media's duration (Closed)

Created:
10 years, 6 months ago by vrk (LEFT CHROMIUM)
Modified:
9 years, 7 months ago
CC:
chromium-reviews, fbarchard, awong, Alpha Left Google, scherkus (not reviewing), Paweł Hajdan Jr.
Visibility:
Public.

Description

Added checks to GetBufferedTime() to cap at the media's duration No longer tries to estimate buffered time when media is fully loaded. Also caps estimation at the duration of the media. BUG=none TEST=media_unittests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=49714

Patch Set 1 #

Patch Set 2 : Changed some data types so that less precision is lost #

Patch Set 3 : Deleted an extra space in assignment #

Patch Set 4 : Simplified some code, fixed a typo from previous patch #

Patch Set 5 : *Actually* fixes the typo this time #

Patch Set 6 : Added unit tests, made minor logic tweaks #

Total comments: 4

Patch Set 7 : Fixed nits from code review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+52 lines, -9 lines) Patch
M media/base/pipeline_impl.h View 2 3 4 5 6 3 chunks +3 lines, -1 line 0 comments Download
M media/base/pipeline_impl.cc View 1 2 3 4 5 6 2 chunks +13 lines, -8 lines 0 comments Download
M media/base/pipeline_impl_unittest.cc View 1 chunk +36 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
vrk (LEFT CHROMIUM)
10 years, 6 months ago (2010-06-10 00:21:10 UTC) #1
vrk (LEFT CHROMIUM)
Hi Alpha, I changed the type of max_buffered_time_ as you suggested. Thanks! On 2010/06/10 00:21:10, ...
10 years, 6 months ago (2010-06-10 01:30:06 UTC) #2
scherkus (not reviewing)
Don't forget BUG= and TEST= in CL description (you can use "none" if there is ...
10 years, 6 months ago (2010-06-10 02:50:23 UTC) #3
vrk (LEFT CHROMIUM)
Added a unit test and made some other minor tweaks to the code. Please take ...
10 years, 6 months ago (2010-06-14 17:14:43 UTC) #4
Alpha Left Google
Please fix two nits. Then LGTM. http://codereview.chromium.org/2782004/diff/16001/17001 File media/base/pipeline_impl.cc (right): http://codereview.chromium.org/2782004/diff/16001/17001#newcode226 media/base/pipeline_impl.cc:226: DCHECK(buffered_bytes_ >= current_bytes_); ...
10 years, 6 months ago (2010-06-14 18:29:16 UTC) #5
vrk (LEFT CHROMIUM)
10 years, 6 months ago (2010-06-14 19:23:37 UTC) #6
Fixed the nits and will commit. Thanks Alpha!

http://codereview.chromium.org/2782004/diff/16001/17001
File media/base/pipeline_impl.cc (right):

http://codereview.chromium.org/2782004/diff/16001/17001#newcode226
media/base/pipeline_impl.cc:226: DCHECK(buffered_bytes_ >= current_bytes_);
On 2010/06/14 18:29:16, Alpha wrote:
> Should use DCHECK_GE(buffered_bytes, current_bytes);
> 
> Also move this line to where the two variables are used, which is the
> calculation block below.

Done.

http://codereview.chromium.org/2782004/diff/16001/17002
File media/base/pipeline_impl.h (right):

http://codereview.chromium.org/2782004/diff/16001/17002#newcode415
media/base/pipeline_impl.h:415: friend class
PipelineImplTest_GetBufferedTime_Test;
On 2010/06/14 18:29:16, Alpha wrote:
> include testing/gtest/include/gtest/gtest_prod.h
> and use FRIEND_TEST instead, it's a marco that does the same thing as what you
> have above.

Done.

Powered by Google App Engine
This is Rietveld 408576698