Index: media/filters/chunk_demuxer.cc |
diff --git a/media/filters/chunk_demuxer.cc b/media/filters/chunk_demuxer.cc |
index d90052876629057ed7479e71744afd14efe3ed82..1e3dba35ca5bb73129bd8730420ce753a9593b47 100644 |
--- a/media/filters/chunk_demuxer.cc |
+++ b/media/filters/chunk_demuxer.cc |
@@ -761,6 +761,14 @@ bool ChunkDemuxer::AppendData(const std::string& id, |
} |
} |
+ if (ranges.size() > 0) { |
+ base::TimeDelta last_timestamp_buffered = ranges.end(ranges.size() - 1); |
+ if (last_timestamp_buffered > duration_) { |
+ duration_ = last_timestamp_buffered; |
+ host_->SetDuration(last_timestamp_buffered); |
+ } |
+ } |
+ |
for (size_t i = 0; i < ranges.size(); ++i) |
host_->AddBufferedTimeRange(ranges.start(i), ranges.end(i)); |
@@ -940,8 +948,6 @@ void ChunkDemuxer::OnStreamParserInitDone(bool success, TimeDelta duration) { |
(!source_id_video_.empty() && !video_)) |
return; |
- host_->SetDuration(duration_); |
acolwell GONE FROM CHROMIUM
2012/07/20 21:18:36
This isn't needed anymore because of the code in O
vrk (LEFT CHROMIUM)
2012/07/26 22:27:26
Yes. My thought was, I was moving this line to hap
|
- |
ChangeState_Locked(WAITING_FOR_START_TIME); |
} |
@@ -1059,6 +1065,9 @@ void ChunkDemuxer::OnNewMediaSegment(const std::string& source_id, |
video_->Seek(start_time_); |
} |
+ duration_ = std::max(duration_, start_time_); |
acolwell GONE FROM CHROMIUM
2012/07/20 21:18:36
A couple questions here:
- Shouldn't the SetDurati
vrk (LEFT CHROMIUM)
2012/07/26 22:27:26
As I said in my other comment, my thinking was I w
|
+ host_->SetDuration(duration_); |
+ |
// The demuxer is now initialized after the |start_timestamp_| was set. |
ChangeState_Locked(INITIALIZED); |
base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK); |