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 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 } | 1297 } |
1298 | 1298 |
1299 void ChunkDemuxer::Abort(const std::string& id, | 1299 void ChunkDemuxer::Abort(const std::string& id, |
1300 TimeDelta append_window_start, | 1300 TimeDelta append_window_start, |
1301 TimeDelta append_window_end, | 1301 TimeDelta append_window_end, |
1302 TimeDelta* timestamp_offset) { | 1302 TimeDelta* timestamp_offset) { |
1303 DVLOG(1) << "Abort(" << id << ")"; | 1303 DVLOG(1) << "Abort(" << id << ")"; |
1304 base::AutoLock auto_lock(lock_); | 1304 base::AutoLock auto_lock(lock_); |
1305 DCHECK(!id.empty()); | 1305 DCHECK(!id.empty()); |
1306 CHECK(IsValidId(id)); | 1306 CHECK(IsValidId(id)); |
| 1307 bool old_waiting_for_data = IsSeekWaitingForData_Locked(); |
1307 source_state_map_[id]->Abort(append_window_start, | 1308 source_state_map_[id]->Abort(append_window_start, |
1308 append_window_end, | 1309 append_window_end, |
1309 timestamp_offset); | 1310 timestamp_offset); |
| 1311 // Abort can possibly emit some buffers. |
| 1312 // Need to check whether seeking can be completed. |
| 1313 if (old_waiting_for_data && !IsSeekWaitingForData_Locked() && |
| 1314 !seek_cb_.is_null()) { |
| 1315 base::ResetAndReturn(&seek_cb_).Run(PIPELINE_OK); |
| 1316 } |
1310 } | 1317 } |
1311 | 1318 |
1312 void ChunkDemuxer::Remove(const std::string& id, TimeDelta start, | 1319 void ChunkDemuxer::Remove(const std::string& id, TimeDelta start, |
1313 TimeDelta end) { | 1320 TimeDelta end) { |
1314 DVLOG(1) << "Remove(" << id << ", " << start.InSecondsF() | 1321 DVLOG(1) << "Remove(" << id << ", " << start.InSecondsF() |
1315 << ", " << end.InSecondsF() << ")"; | 1322 << ", " << end.InSecondsF() << ")"; |
1316 base::AutoLock auto_lock(lock_); | 1323 base::AutoLock auto_lock(lock_); |
1317 | 1324 |
1318 DCHECK(!id.empty()); | 1325 DCHECK(!id.empty()); |
1319 CHECK(IsValidId(id)); | 1326 CHECK(IsValidId(id)); |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1739 } | 1746 } |
1740 | 1747 |
1741 void ChunkDemuxer::ShutdownAllStreams() { | 1748 void ChunkDemuxer::ShutdownAllStreams() { |
1742 for (SourceStateMap::iterator itr = source_state_map_.begin(); | 1749 for (SourceStateMap::iterator itr = source_state_map_.begin(); |
1743 itr != source_state_map_.end(); ++itr) { | 1750 itr != source_state_map_.end(); ++itr) { |
1744 itr->second->Shutdown(); | 1751 itr->second->Shutdown(); |
1745 } | 1752 } |
1746 } | 1753 } |
1747 | 1754 |
1748 } // namespace media | 1755 } // namespace media |
OLD | NEW |