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

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

Issue 2158923004: Convert media constants to constexpr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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/ffmpeg_audio_decoder.h" 5 #include "media/filters/ffmpeg_audio_decoder.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 const scoped_refptr<DecoderBuffer>& buffer, 218 const scoped_refptr<DecoderBuffer>& buffer,
219 const DecodeCB& decode_cb) { 219 const DecodeCB& decode_cb) {
220 DCHECK(task_runner_->BelongsToCurrentThread()); 220 DCHECK(task_runner_->BelongsToCurrentThread());
221 DCHECK_NE(state_, kUninitialized); 221 DCHECK_NE(state_, kUninitialized);
222 DCHECK_NE(state_, kDecodeFinished); 222 DCHECK_NE(state_, kDecodeFinished);
223 DCHECK_NE(state_, kError); 223 DCHECK_NE(state_, kError);
224 DCHECK(buffer.get()); 224 DCHECK(buffer.get());
225 225
226 // Make sure we are notified if http://crbug.com/49709 returns. Issue also 226 // Make sure we are notified if http://crbug.com/49709 returns. Issue also
227 // occurs with some damaged files. 227 // occurs with some damaged files.
228 if (!buffer->end_of_stream() && buffer->timestamp() == kNoTimestamp()) { 228 if (!buffer->end_of_stream() && buffer->timestamp() == kNoTimestamp) {
229 DVLOG(1) << "Received a buffer without timestamps!"; 229 DVLOG(1) << "Received a buffer without timestamps!";
230 decode_cb.Run(DecodeStatus::DECODE_ERROR); 230 decode_cb.Run(DecodeStatus::DECODE_ERROR);
231 return; 231 return;
232 } 232 }
233 233
234 bool has_produced_frame; 234 bool has_produced_frame;
235 do { 235 do {
236 has_produced_frame = false; 236 has_produced_frame = false;
237 if (!FFmpegDecode(buffer, &has_produced_frame)) { 237 if (!FFmpegDecode(buffer, &has_produced_frame)) {
238 state_ = kError; 238 state_ = kError;
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 return true; 431 return true;
432 } 432 }
433 433
434 void FFmpegAudioDecoder::ResetTimestampState() { 434 void FFmpegAudioDecoder::ResetTimestampState() {
435 discard_helper_.reset(new AudioDiscardHelper(config_.samples_per_second(), 435 discard_helper_.reset(new AudioDiscardHelper(config_.samples_per_second(),
436 config_.codec_delay())); 436 config_.codec_delay()));
437 discard_helper_->Reset(config_.codec_delay()); 437 discard_helper_->Reset(config_.codec_delay());
438 } 438 }
439 439
440 } // namespace media 440 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698