| OLD | NEW |
| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 | 823 |
| 824 return true; | 824 return true; |
| 825 } | 825 } |
| 826 | 826 |
| 827 void ChunkDemuxer::Abort(const std::string& id) { | 827 void ChunkDemuxer::Abort(const std::string& id) { |
| 828 DVLOG(1) << "Abort(" << id << ")"; | 828 DVLOG(1) << "Abort(" << id << ")"; |
| 829 DCHECK(!id.empty()); | 829 DCHECK(!id.empty()); |
| 830 CHECK(IsValidId(id)); | 830 CHECK(IsValidId(id)); |
| 831 | 831 |
| 832 stream_parser_map_[id]->Flush(); | 832 stream_parser_map_[id]->Flush(); |
| 833 source_info_map_[id].can_update_offset = true; |
| 833 } | 834 } |
| 834 | 835 |
| 835 void ChunkDemuxer::SetDuration(base::TimeDelta duration) { | 836 void ChunkDemuxer::SetDuration(base::TimeDelta duration) { |
| 836 DVLOG(1) << "SetDuration(" << duration.InSecondsF() << ")"; | 837 DVLOG(1) << "SetDuration(" << duration.InSecondsF() << ")"; |
| 837 | 838 |
| 838 if (duration == duration_) | 839 if (duration == duration_) |
| 839 return; | 840 return; |
| 840 | 841 |
| 841 UpdateDuration(duration); | 842 UpdateDuration(duration); |
| 842 | 843 |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1179 | 1180 |
| 1180 Ranges<TimeDelta> ChunkDemuxer::GetBufferedRanges() const { | 1181 Ranges<TimeDelta> ChunkDemuxer::GetBufferedRanges() const { |
| 1181 if (audio_ && !video_) | 1182 if (audio_ && !video_) |
| 1182 return audio_->GetBufferedRanges(duration_); | 1183 return audio_->GetBufferedRanges(duration_); |
| 1183 else if (!audio_ && video_) | 1184 else if (!audio_ && video_) |
| 1184 return video_->GetBufferedRanges(duration_); | 1185 return video_->GetBufferedRanges(duration_); |
| 1185 return ComputeIntersection(); | 1186 return ComputeIntersection(); |
| 1186 } | 1187 } |
| 1187 | 1188 |
| 1188 } // namespace media | 1189 } // namespace media |
| OLD | NEW |