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

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

Issue 311373004: Consolidate and improve audio decoding test for all decoders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Expand tests. Created 6 years, 6 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
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 "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "media/base/audio_buffer.h" 9 #include "media/base/audio_buffer.h"
10 #include "media/base/audio_bus.h" 10 #include "media/base/audio_bus.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 state_ = kUninitialized; 203 state_ = kUninitialized;
204 } 204 }
205 205
206 void FFmpegAudioDecoder::DecodeBuffer( 206 void FFmpegAudioDecoder::DecodeBuffer(
207 const scoped_refptr<DecoderBuffer>& buffer, 207 const scoped_refptr<DecoderBuffer>& buffer,
208 const DecodeCB& decode_cb) { 208 const DecodeCB& decode_cb) {
209 DCHECK(task_runner_->BelongsToCurrentThread()); 209 DCHECK(task_runner_->BelongsToCurrentThread());
210 DCHECK_NE(state_, kUninitialized); 210 DCHECK_NE(state_, kUninitialized);
211 DCHECK_NE(state_, kDecodeFinished); 211 DCHECK_NE(state_, kDecodeFinished);
212 DCHECK_NE(state_, kError); 212 DCHECK_NE(state_, kError);
213
214 DCHECK(buffer); 213 DCHECK(buffer);
215 214
216 // Make sure we are notified if http://crbug.com/49709 returns. Issue also 215 // Make sure we are notified if http://crbug.com/49709 returns. Issue also
217 // occurs with some damaged files. 216 // occurs with some damaged files.
218 if (!buffer->end_of_stream() && buffer->timestamp() == kNoTimestamp()) { 217 if (!buffer->end_of_stream() && buffer->timestamp() == kNoTimestamp()) {
219 DVLOG(1) << "Received a buffer without timestamps!"; 218 DVLOG(1) << "Received a buffer without timestamps!";
220 decode_cb.Run(kDecodeError); 219 decode_cb.Run(kDecodeError);
221 return; 220 return;
222 } 221 }
223 222
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 392
394 ResetTimestampState(); 393 ResetTimestampState();
395 return true; 394 return true;
396 } 395 }
397 396
398 void FFmpegAudioDecoder::ResetTimestampState() { 397 void FFmpegAudioDecoder::ResetTimestampState() {
399 discard_helper_->Reset(config_.codec_delay()); 398 discard_helper_->Reset(config_.codec_delay());
400 } 399 }
401 400
402 } // namespace media 401 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698