OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |