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

Side by Side Diff: media/filters/chunk_demuxer.cc

Issue 10701130: Fix buffered range reporting for ChunkDemuxer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/base/pipeline.cc ('k') | media/filters/pipeline_integration_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/filters/chunk_demuxer.h" 5 #include "media/filters/chunk_demuxer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 DVLOG(1) << "AppendData(): called in unexpected state " << state_; 716 DVLOG(1) << "AppendData(): called in unexpected state " << state_;
717 return false; 717 return false;
718 } 718 }
719 719
720 // Check to see if data was appended at the pending seek point. This 720 // Check to see if data was appended at the pending seek point. This
721 // indicates we have parsed enough data to complete the seek. 721 // indicates we have parsed enough data to complete the seek.
722 if (old_seek_pending && !IsSeekPending_Locked() && !seek_cb_.is_null()) { 722 if (old_seek_pending && !IsSeekPending_Locked() && !seek_cb_.is_null()) {
723 std::swap(cb, seek_cb_); 723 std::swap(cb, seek_cb_);
724 } 724 }
725 725
726 if (duration_ > TimeDelta() && duration_ != kInfiniteDuration()) { 726 if (audio_ && !video_) {
Ami GONE FROM CHROMIUM 2012/07/10 23:11:12 Do you want to DCHECK these during init?
acolwell GONE FROM CHROMIUM 2012/07/10 23:19:30 No. These were just here for the old byte range co
727 if (audio_ && !video_) { 727 ranges = audio_->GetBufferedRanges();
728 ranges = audio_->GetBufferedRanges(); 728 } else if (!audio_ && video_) {
729 } else if (!audio_ && video_) { 729 ranges = video_->GetBufferedRanges();
730 ranges = video_->GetBufferedRanges(); 730 } else {
731 } else { 731 ranges = ComputeIntersection();
732 ranges = ComputeIntersection();
733 }
734 } 732 }
735 } 733 }
736 734
737 for (size_t i = 0; i < ranges.size(); ++i) 735 for (size_t i = 0; i < ranges.size(); ++i)
738 host_->AddBufferedTimeRange(ranges.start(i), ranges.end(i)); 736 host_->AddBufferedTimeRange(ranges.start(i), ranges.end(i));
739 737
740 if (!cb.is_null()) 738 if (!cb.is_null())
741 cb.Run(PIPELINE_OK); 739 cb.Run(PIPELINE_OK);
742 740
743 return true; 741 return true;
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 // TODO(vrk): There should be a special case for the first appends where all 978 // TODO(vrk): There should be a special case for the first appends where all
981 // streams (for both demuxed and muxed case) begin at the earliest stream 979 // streams (for both demuxed and muxed case) begin at the earliest stream
982 // timestamp. (crbug.com/132815) 980 // timestamp. (crbug.com/132815)
983 if (audio_ && source_id == source_id_audio_) 981 if (audio_ && source_id == source_id_audio_)
984 audio_->OnNewMediaSegment(start_timestamp); 982 audio_->OnNewMediaSegment(start_timestamp);
985 if (video_ && source_id == source_id_video_) 983 if (video_ && source_id == source_id_video_)
986 video_->OnNewMediaSegment(start_timestamp); 984 video_->OnNewMediaSegment(start_timestamp);
987 } 985 }
988 986
989 } // namespace media 987 } // namespace media
OLDNEW
« no previous file with comments | « media/base/pipeline.cc ('k') | media/filters/pipeline_integration_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698