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

Unified Diff: media/filters/opus_audio_decoder.cc

Issue 251583003: Ensure DiscardPadding is parsed as a signed integer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove bad rebase. 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 | « content/browser/media/media_source_browsertest.cc ('k') | media/filters/pipeline_integration_test.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 e54bf08f502657478d362eb4593eabcb0d2e8aef..4e5e71f70e5aea18c5e7058b04a4d58413e3fcf6 100644
--- a/media/filters/opus_audio_decoder.cc
+++ b/media/filters/opus_audio_decoder.cc
@@ -522,22 +522,25 @@ bool OpusAudioDecoder::Decode(const scoped_refptr<DecoderBuffer>& input,
}
output_buffer->get()->TrimEnd(discard_padding);
frames_to_output -= discard_padding;
+ } else {
+ DCHECK_EQ(input->discard_padding().InMicroseconds(), 0);
}
} else {
frames_to_discard_ -= frames_to_output;
frames_to_output = 0;
}
+ // Discard the buffer to indicate we need more data.
+ if (!frames_to_output) {
+ *output_buffer = NULL;
+ return true;
+ }
+
// Assign timestamp and duration to the buffer.
output_buffer->get()->set_timestamp(output_timestamp_helper_->GetTimestamp());
output_buffer->get()->set_duration(
output_timestamp_helper_->GetFrameDuration(frames_to_output));
- output_timestamp_helper_->AddFrames(frames_decoded);
-
- // Discard the buffer to indicate we need more data.
- if (!frames_to_output)
- *output_buffer = NULL;
-
+ output_timestamp_helper_->AddFrames(frames_to_output);
return true;
}
« no previous file with comments | « content/browser/media/media_source_browsertest.cc ('k') | media/filters/pipeline_integration_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698