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

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

Issue 312403002: Fix crashes caused when SourceBuffer.remove() is called starting at the presentation duration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address CR comments. Created 6 years, 6 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
« no previous file with comments | « no previous file | media/filters/chunk_demuxer_unittest.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 <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
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
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
OLDNEW
« no previous file with comments | « no previous file | media/filters/chunk_demuxer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698