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

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

Issue 1786733004: Revert of media config: expand is_encrypted to a struct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/frame_processor_unittest.cc ('k') | media/filters/source_buffer_stream.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/opus_audio_decoder.h" 5 #include "media/filters/opus_audio_decoder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <cmath> 10 #include <cmath>
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 << config_.codec_delay(); 262 << config_.codec_delay();
263 return false; 263 return false;
264 } 264 }
265 265
266 if (config_.codec_delay() != opus_extra_data.skip_samples) { 266 if (config_.codec_delay() != opus_extra_data.skip_samples) {
267 DLOG(WARNING) << "Invalid file. Codec Delay in container does not match " 267 DLOG(WARNING) << "Invalid file. Codec Delay in container does not match "
268 << "the value in Opus Extra Data. " << config_.codec_delay() 268 << "the value in Opus Extra Data. " << config_.codec_delay()
269 << " vs " << opus_extra_data.skip_samples; 269 << " vs " << opus_extra_data.skip_samples;
270 config_.Initialize(config_.codec(), config_.sample_format(), 270 config_.Initialize(config_.codec(), config_.sample_format(),
271 config_.channel_layout(), config_.samples_per_second(), 271 config_.channel_layout(), config_.samples_per_second(),
272 config_.extra_data(), config_.encryption_scheme(), 272 config_.extra_data(), config_.is_encrypted(),
273 config_.seek_preroll(), opus_extra_data.skip_samples); 273 config_.seek_preroll(), opus_extra_data.skip_samples);
274 } 274 }
275 275
276 uint8_t channel_mapping[OPUS_MAX_VORBIS_CHANNELS] = {0}; 276 uint8_t channel_mapping[OPUS_MAX_VORBIS_CHANNELS] = {0};
277 memcpy(&channel_mapping, kDefaultOpusChannelLayout, 277 memcpy(&channel_mapping, kDefaultOpusChannelLayout,
278 OPUS_MAX_CHANNELS_WITH_DEFAULT_LAYOUT); 278 OPUS_MAX_CHANNELS_WITH_DEFAULT_LAYOUT);
279 279
280 if (channel_count > OPUS_MAX_CHANNELS_WITH_DEFAULT_LAYOUT) { 280 if (channel_count > OPUS_MAX_CHANNELS_WITH_DEFAULT_LAYOUT) {
281 RemapOpusChannelLayout(opus_extra_data.stream_map, 281 RemapOpusChannelLayout(opus_extra_data.stream_map,
282 channel_count, 282 channel_count,
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 output_buffer->get()->TrimEnd(trim_frames); 359 output_buffer->get()->TrimEnd(trim_frames);
360 360
361 // Handles discards and timestamping. Discard the buffer if more data needed. 361 // Handles discards and timestamping. Discard the buffer if more data needed.
362 if (!discard_helper_->ProcessBuffers(input, *output_buffer)) 362 if (!discard_helper_->ProcessBuffers(input, *output_buffer))
363 *output_buffer = nullptr; 363 *output_buffer = nullptr;
364 364
365 return true; 365 return true;
366 } 366 }
367 367
368 } // namespace media 368 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/frame_processor_unittest.cc ('k') | media/filters/source_buffer_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698