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

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

Issue 382123002: Zero initialize OPUS stream mapping data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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/opus_audio_decoder.h" 5 #include "media/filters/opus_audio_decoder.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/sys_byteorder.h" 10 #include "base/sys_byteorder.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 static const int kOpusExtraDataStreamMapOffset = 166 static const int kOpusExtraDataStreamMapOffset =
167 kOpusExtraDataNumStreamsOffset + 2; 167 kOpusExtraDataNumStreamsOffset + 2;
168 168
169 struct OpusExtraData { 169 struct OpusExtraData {
170 OpusExtraData() 170 OpusExtraData()
171 : channels(0), 171 : channels(0),
172 skip_samples(0), 172 skip_samples(0),
173 channel_mapping(0), 173 channel_mapping(0),
174 num_streams(0), 174 num_streams(0),
175 num_coupled(0), 175 num_coupled(0),
176 gain_db(0) { 176 gain_db(0),
177 stream_map() {
177 memcpy(stream_map, 178 memcpy(stream_map,
178 kDefaultOpusChannelLayout, 179 kDefaultOpusChannelLayout,
179 kMaxChannelsWithDefaultLayout); 180 kMaxChannelsWithDefaultLayout);
180 } 181 }
181 int channels; 182 int channels;
182 uint16 skip_samples; 183 uint16 skip_samples;
183 int channel_mapping; 184 int channel_mapping;
184 int num_streams; 185 int num_streams;
185 int num_coupled; 186 int num_coupled;
186 int16 gain_db; 187 int16 gain_db;
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 output_buffer->get()->TrimEnd(trim_frames); 478 output_buffer->get()->TrimEnd(trim_frames);
478 479
479 // Handles discards and timestamping. Discard the buffer if more data needed. 480 // Handles discards and timestamping. Discard the buffer if more data needed.
480 if (!discard_helper_->ProcessBuffers(input, *output_buffer)) 481 if (!discard_helper_->ProcessBuffers(input, *output_buffer))
481 *output_buffer = NULL; 482 *output_buffer = NULL;
482 483
483 return true; 484 return true;
484 } 485 }
485 486
486 } // namespace media 487 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698