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

Unified Diff: media/filters/source_buffer_stream.cc

Issue 11722008: Encrypted Media: Support config change in DecryptingDemuxerStream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments resolved Created 7 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/decrypting_demuxer_stream_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/source_buffer_stream.cc
diff --git a/media/filters/source_buffer_stream.cc b/media/filters/source_buffer_stream.cc
index 5507acc7c4b5134ef2c5b636432e2a4ed7a5364b..3f1b42d82662bc262607896ee3c1daa15e58e157 100644
--- a/media/filters/source_buffer_stream.cc
+++ b/media/filters/source_buffer_stream.cc
@@ -557,7 +557,6 @@ int SourceBufferStream::FreeBuffers(int total_bytes_to_free,
SourceBufferRange* new_range_for_append = NULL;
while (!ranges_.empty() && bytes_to_free > 0) {
-
SourceBufferRange* current_range = NULL;
BufferQueue buffers;
int bytes_deleted = 0;
@@ -1061,6 +1060,11 @@ bool SourceBufferStream::UpdateAudioConfig(const AudioDecoderConfig& config) {
return false;
}
+ if (audio_configs_[0]->is_encrypted() != config.is_encrypted()) {
+ MEDIA_LOG(log_cb_) << "Audio encryption changes not allowed.";
+ return false;
+ }
+
// Check to see if the new config matches an existing one.
for (size_t i = 0; i < audio_configs_.size(); ++i) {
if (config.Matches(*audio_configs_[i])) {
@@ -1091,6 +1095,11 @@ bool SourceBufferStream::UpdateVideoConfig(const VideoDecoderConfig& config) {
return false;
}
+ if (video_configs_[0]->is_encrypted() != config.is_encrypted()) {
+ MEDIA_LOG(log_cb_) << "Video encryption changes not allowed.";
+ return false;
+ }
+
// Check to see if the new config matches an existing one.
for (size_t i = 0; i < video_configs_.size(); ++i) {
if (config.Matches(*video_configs_[i])) {
« no previous file with comments | « media/filters/decrypting_demuxer_stream_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698