Commit c510d6bb authored by falken@chromium.org's avatar falken@chromium.org

Revert of Update SourceBufferStream and its unit tests to always expect valid...

Revert of Update SourceBufferStream and its unit tests to always expect valid durations. (https://codereview.chromium.org/379693002/)

Reason for revert:
This seems to have broken several layout tests:

event-attributes.html 
media-controller-time-clamp.html 
video-currentTime-delay.html 
video-currentTime-set.html 
video-duration-known-after-eos.html 
video-loop.html 
video-playbackrate.html 
video-played-collapse.html 
video-seek-past-end-paused.html 
video-seek-past-end-playing.html 
video-seek-to-duration-with-playbackrate-zero.html 

See for example this build:
http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.6%20(dbg)/builds/16392

Original issue's description:
> Update SourceBufferStream and its unit tests to always expect valid durations.
> 
> This change fixes the SourceBufferStream unit tests so that they always
> provide valid durations for buffers that it passes to SourceBufferStream.
> I've also added code to SoureBufferStream to verify that it always gets
> buffers with valid durations.
> 
> Minor tweaks to test expectations were needed to compensate for the
> SourceBufferStream behaving differently when it got actual durations instead
> of using the durations it made up. In most cases I just used the duration
> the SourceBufferStream was ultimately using. In a few cases the duration
> the SourceBufferStream was generating didn't make any sense so I simply
> changed the expectations to match the new behavior.
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=283365

TBR=wolenetz@chromium.org,dalecurtis@chromium.org,acolwell@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/392193003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283390 0039d316-1c4b-4281-b951-d872f2087c98
parent cb320358
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "media/base/buffers.h"
#include "media/base/decrypt_config.h" #include "media/base/decrypt_config.h"
#include "media/base/media_export.h" #include "media/base/media_export.h"
...@@ -78,9 +77,6 @@ class MEDIA_EXPORT DecoderBuffer ...@@ -78,9 +77,6 @@ class MEDIA_EXPORT DecoderBuffer
void set_duration(base::TimeDelta duration) { void set_duration(base::TimeDelta duration) {
DCHECK(!end_of_stream()); DCHECK(!end_of_stream());
DCHECK(duration == kNoTimestamp() ||
(duration >= base::TimeDelta() && duration != kInfiniteDuration()))
<< duration.InSecondsF();
duration_ = duration; duration_ = duration;
} }
......
...@@ -106,11 +106,6 @@ void StreamParserBuffer::SetConfigId(int config_id) { ...@@ -106,11 +106,6 @@ void StreamParserBuffer::SetConfigId(int config_id) {
void StreamParserBuffer::ConvertToSpliceBuffer( void StreamParserBuffer::ConvertToSpliceBuffer(
const BufferQueue& pre_splice_buffers) { const BufferQueue& pre_splice_buffers) {
DCHECK(splice_buffers_.empty()); DCHECK(splice_buffers_.empty());
DCHECK(duration() > base::TimeDelta())
<< "Only buffers with a valid duration can convert to a splice buffer."
<< " pts " << timestamp().InSecondsF()
<< " dts " << GetDecodeTimestamp().InSecondsF()
<< " dur " << duration().InSecondsF();
DCHECK(!end_of_stream()); DCHECK(!end_of_stream());
// Make a copy of this first, before making any changes. // Make a copy of this first, before making any changes.
...@@ -144,8 +139,6 @@ void StreamParserBuffer::ConvertToSpliceBuffer( ...@@ -144,8 +139,6 @@ void StreamParserBuffer::ConvertToSpliceBuffer(
// The splice duration is the duration of all buffers before the splice plus // The splice duration is the duration of all buffers before the splice plus
// the highest ending timestamp after the splice point. // the highest ending timestamp after the splice point.
DCHECK(overlapping_buffer->duration() > base::TimeDelta());
DCHECK(pre_splice_buffers.back()->duration() > base::TimeDelta());
set_duration( set_duration(
std::max(overlapping_buffer->timestamp() + overlapping_buffer->duration(), std::max(overlapping_buffer->timestamp() + overlapping_buffer->duration(),
pre_splice_buffers.back()->timestamp() + pre_splice_buffers.back()->timestamp() +
......
...@@ -717,11 +717,6 @@ bool SourceBufferStream::IsMonotonicallyIncreasing( ...@@ -717,11 +717,6 @@ bool SourceBufferStream::IsMonotonicallyIncreasing(
base::TimeDelta current_timestamp = (*itr)->GetDecodeTimestamp(); base::TimeDelta current_timestamp = (*itr)->GetDecodeTimestamp();
bool current_is_keyframe = (*itr)->IsKeyframe(); bool current_is_keyframe = (*itr)->IsKeyframe();
DCHECK(current_timestamp != kNoTimestamp()); DCHECK(current_timestamp != kNoTimestamp());
DCHECK((*itr)->duration() >= base::TimeDelta())
<< "Packet with invalid duration."
<< " pts " << (*itr)->timestamp().InSecondsF()
<< " dts " << (*itr)->GetDecodeTimestamp().InSecondsF()
<< " dur " << (*itr)->duration().InSecondsF();
if (prev_timestamp != kNoTimestamp()) { if (prev_timestamp != kNoTimestamp()) {
if (current_timestamp < prev_timestamp) { if (current_timestamp < prev_timestamp) {
......
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