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 <limits> | 8 #include <limits> |
9 #include <list> | 9 #include <list> |
10 | 10 |
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 } | 1315 } |
1316 | 1316 |
1317 void ChunkDemuxer::Remove(const std::string& id, TimeDelta start, | 1317 void ChunkDemuxer::Remove(const std::string& id, TimeDelta start, |
1318 TimeDelta end) { | 1318 TimeDelta end) { |
1319 DVLOG(1) << "Remove(" << id << ", " << start.InSecondsF() | 1319 DVLOG(1) << "Remove(" << id << ", " << start.InSecondsF() |
1320 << ", " << end.InSecondsF() << ")"; | 1320 << ", " << end.InSecondsF() << ")"; |
1321 base::AutoLock auto_lock(lock_); | 1321 base::AutoLock auto_lock(lock_); |
1322 | 1322 |
1323 DCHECK(!id.empty()); | 1323 DCHECK(!id.empty()); |
1324 CHECK(IsValidId(id)); | 1324 CHECK(IsValidId(id)); |
| 1325 DCHECK(start >= base::TimeDelta()) << start.InSecondsF(); |
| 1326 DCHECK(start < end) << "start " << start.InSecondsF() |
| 1327 << " end " << end.InSecondsF(); |
| 1328 DCHECK(duration_ != kNoTimestamp()); |
| 1329 DCHECK(start <= duration_) << "start " << start.InSecondsF() |
| 1330 << " duration " << duration_.InSecondsF(); |
| 1331 |
| 1332 if (start == duration_) |
| 1333 return; |
| 1334 |
1325 source_state_map_[id]->Remove(start, end, duration_); | 1335 source_state_map_[id]->Remove(start, end, duration_); |
1326 } | 1336 } |
1327 | 1337 |
1328 double ChunkDemuxer::GetDuration() { | 1338 double ChunkDemuxer::GetDuration() { |
1329 base::AutoLock auto_lock(lock_); | 1339 base::AutoLock auto_lock(lock_); |
1330 return GetDuration_Locked(); | 1340 return GetDuration_Locked(); |
1331 } | 1341 } |
1332 | 1342 |
1333 double ChunkDemuxer::GetDuration_Locked() { | 1343 double ChunkDemuxer::GetDuration_Locked() { |
1334 lock_.AssertAcquired(); | 1344 lock_.AssertAcquired(); |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1734 } | 1744 } |
1735 | 1745 |
1736 void ChunkDemuxer::ShutdownAllStreams() { | 1746 void ChunkDemuxer::ShutdownAllStreams() { |
1737 for (SourceStateMap::iterator itr = source_state_map_.begin(); | 1747 for (SourceStateMap::iterator itr = source_state_map_.begin(); |
1738 itr != source_state_map_.end(); ++itr) { | 1748 itr != source_state_map_.end(); ++itr) { |
1739 itr->second->Shutdown(); | 1749 itr->second->Shutdown(); |
1740 } | 1750 } |
1741 } | 1751 } |
1742 | 1752 |
1743 } // namespace media | 1753 } // namespace media |
OLD | NEW |