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

Unified Diff: media/filters/opus_audio_decoder.cc

Issue 257563007: Don't double correct for discarded codec delay frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style cleanup. Fix rendundant Initialize(). Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/audio_file_reader.cc ('k') | media/filters/opus_audio_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/opus_audio_decoder.cc
diff --git a/media/filters/opus_audio_decoder.cc b/media/filters/opus_audio_decoder.cc
index 4e5e71f70e5aea18c5e7058b04a4d58413e3fcf6..5ddc244ce952c46a18f81f9d099bc6c5e245b4ee 100644
--- a/media/filters/opus_audio_decoder.cc
+++ b/media/filters/opus_audio_decoder.cc
@@ -289,6 +289,9 @@ void OpusAudioDecoder::Reset(const base::Closure& closure) {
void OpusAudioDecoder::Stop() {
DCHECK(task_runner_->BelongsToCurrentThread());
+ if (!opus_decoder_)
+ return;
+
opus_multistream_decoder_ctl(opus_decoder_, OPUS_RESET_STATE);
ResetTimestampState();
CloseDecoder();
@@ -398,7 +401,8 @@ bool OpusAudioDecoder::ConfigureDecoder() {
if (config_.codec_delay() != opus_extra_data.skip_samples) {
DLOG(ERROR) << "Invalid file. Codec Delay in container does not match the "
- << "value in Opus Extra Data.";
+ << "value in Opus Extra Data. " << config_.codec_delay()
+ << " vs " << opus_extra_data.skip_samples;
return false;
}
@@ -491,12 +495,7 @@ bool OpusAudioDecoder::Decode(const scoped_refptr<DecoderBuffer>& input,
if (output_timestamp_helper_->base_timestamp() == kNoTimestamp() &&
!input->end_of_stream()) {
DCHECK(input->timestamp() != kNoTimestamp());
- // Adjust the timestamp helper so the base timestamp is corrected for frames
- // dropped due to codec delay.
output_timestamp_helper_->SetBaseTimestamp(input->timestamp());
- output_timestamp_helper_->SetBaseTimestamp(
- input->timestamp() -
- output_timestamp_helper_->GetFrameDuration(config_.codec_delay()));
}
// Trim off any extraneous allocation.
« no previous file with comments | « media/filters/audio_file_reader.cc ('k') | media/filters/opus_audio_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698