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

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

Issue 2856633002: Adding defensive CHECKs for AudioDecoderConfig crash (Closed)
Patch Set: Created 3 years, 7 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 | « media/filters/chunk_demuxer.cc ('k') | no next file » | 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/source_buffer_stream.h" 5 #include "media/filters/source_buffer_stream.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <sstream> 9 #include <sstream>
10 #include <string> 10 #include <string>
(...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 1544
1545 if (!selected_range_) 1545 if (!selected_range_)
1546 return true; 1546 return true;
1547 1547
1548 return selected_range_ == ranges_.back(); 1548 return selected_range_ == ranges_.back();
1549 } 1549 }
1550 1550
1551 const AudioDecoderConfig& SourceBufferStream::GetCurrentAudioDecoderConfig() { 1551 const AudioDecoderConfig& SourceBufferStream::GetCurrentAudioDecoderConfig() {
1552 if (config_change_pending_) 1552 if (config_change_pending_)
1553 CompleteConfigChange(); 1553 CompleteConfigChange();
1554 // Trying to track down crash. http://crbug.com/715761
1555 CHECK(current_config_index_ >= 0 &&
1556 static_cast<size_t>(current_config_index_) < audio_configs_.size());
1554 return audio_configs_[current_config_index_]; 1557 return audio_configs_[current_config_index_];
1555 } 1558 }
1556 1559
1557 const VideoDecoderConfig& SourceBufferStream::GetCurrentVideoDecoderConfig() { 1560 const VideoDecoderConfig& SourceBufferStream::GetCurrentVideoDecoderConfig() {
1558 if (config_change_pending_) 1561 if (config_change_pending_)
1559 CompleteConfigChange(); 1562 CompleteConfigChange();
1563 // Trying to track down crash. http://crbug.com/715761
1564 CHECK(current_config_index_ >= 0 &&
1565 static_cast<size_t>(current_config_index_) < video_configs_.size());
1560 return video_configs_[current_config_index_]; 1566 return video_configs_[current_config_index_];
1561 } 1567 }
1562 1568
1563 const TextTrackConfig& SourceBufferStream::GetCurrentTextTrackConfig() { 1569 const TextTrackConfig& SourceBufferStream::GetCurrentTextTrackConfig() {
1564 return text_track_config_; 1570 return text_track_config_;
1565 } 1571 }
1566 1572
1567 base::TimeDelta SourceBufferStream::GetMaxInterbufferDistance() const { 1573 base::TimeDelta SourceBufferStream::GetMaxInterbufferDistance() const {
1568 if (max_interbuffer_distance_ == kNoTimestamp) 1574 if (max_interbuffer_distance_ == kNoTimestamp)
1569 return base::TimeDelta::FromMilliseconds(kDefaultBufferDurationInMs); 1575 return base::TimeDelta::FromMilliseconds(kDefaultBufferDurationInMs);
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1780 1786
1781 if (!have_preroll_buffer) 1787 if (!have_preroll_buffer)
1782 return false; 1788 return false;
1783 1789
1784 pending_buffer_.swap(*out_buffer); 1790 pending_buffer_.swap(*out_buffer);
1785 pending_buffers_complete_ = false; 1791 pending_buffers_complete_ = false;
1786 return true; 1792 return true;
1787 } 1793 }
1788 1794
1789 } // namespace media 1795 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698