Index: media/webm/webm_cluster_parser.cc |
diff --git a/media/webm/webm_cluster_parser.cc b/media/webm/webm_cluster_parser.cc |
index be5e724c14af8d4f0dc23c4f1d98b7e401a031be..0af46078d5253938650f71832f86f373bb9799d6 100644 |
--- a/media/webm/webm_cluster_parser.cc |
+++ b/media/webm/webm_cluster_parser.cc |
@@ -231,77 +231,20 @@ WebMClusterParser::Track::~Track() {} |
bool WebMClusterParser::Track::AddBuffer( |
const scoped_refptr<StreamParserBuffer>& buffer) { |
- if (!buffers_.empty() && |
- buffer->GetTimestamp() == buffers_.back()->GetTimestamp()) { |
acolwell GONE FROM CHROMIUM
2012/07/02 17:12:33
Why is this being removed? We want to make sure th
vrk (LEFT CHROMIUM)
2012/07/04 02:50:18
Talked offline: we want to keep == possible becaus
|
- DVLOG(1) << "Got a block timecode that is not strictly monotonically " |
- << "increasing for track " << track_num_; |
- return false; |
- } |
- |
- if (!delayed_buffers_.empty()) { |
- // Update the duration of the delayed buffer and place it into the queue. |
- scoped_refptr<StreamParserBuffer> delayed_buffer = delayed_buffers_.front(); |
- |
- // If we get another buffer with the same timestamp, put it in the delay |
- // queue. |
- if (buffer->GetTimestamp() == delayed_buffer->GetTimestamp()) { |
- delayed_buffers_.push_back(buffer); |
- |
- // If this buffer happens to have a duration, use it to set the |
- // duration on all the other buffers in the queue. |
- if (buffer->GetDuration() != kNoTimestamp()) |
- SetDelayedBufferDurations(buffer->GetDuration()); |
- |
- return true; |
- } |
- |
- base::TimeDelta new_duration = |
- buffer->GetTimestamp() - delayed_buffer->GetTimestamp(); |
- |
- if (new_duration < base::TimeDelta()) { |
- DVLOG(1) << "Detected out of order timestamps."; |
- return false; |
- } |
- |
- SetDelayedBufferDurations(new_duration); |
- } |
- |
- // Place the buffer in delayed buffer slot if we don't know |
- // its duration. |
- if (buffer->GetDuration() == kNoTimestamp()) { |
- delayed_buffers_.push_back(buffer); |
- return true; |
- } |
- |
AddToBufferQueue(buffer); |
return true; |
} |
void WebMClusterParser::Track::Reset() { |
buffers_.clear(); |
- delayed_buffers_.clear(); |
} |
void WebMClusterParser::Track::ClearBufferQueue() { |
acolwell GONE FROM CHROMIUM
2012/07/02 17:12:33
Can all callsites for this method be replaced with
vrk (LEFT CHROMIUM)
2012/07/04 02:50:18
Done.
|
buffers_.clear(); |
} |
-void WebMClusterParser::Track::SetDelayedBufferDurations( |
- base::TimeDelta duration) { |
- |
- for (BufferQueue::iterator itr = delayed_buffers_.begin(); |
- itr < delayed_buffers_.end(); ++itr) { |
- (*itr)->SetDuration(duration); |
- |
- AddToBufferQueue(*itr); |
- } |
- delayed_buffers_.clear(); |
-} |
- |
void WebMClusterParser::Track::AddToBufferQueue( |
acolwell GONE FROM CHROMIUM
2012/07/02 17:12:33
Move this entire function body into AddBuffer() si
vrk (LEFT CHROMIUM)
2012/07/04 02:50:18
Done.
|
const scoped_refptr<StreamParserBuffer>& buffer) { |
- DCHECK(buffer->GetDuration() > base::TimeDelta()); |
- |
DVLOG(2) << "AddToBufferQueue() : " << track_num_ |
<< " ts " << buffer->GetTimestamp().InSecondsF() |
<< " dur " << buffer->GetDuration().InSecondsF() |