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

Unified Diff: chrome/browser/speech/audio_encoder.cc

Issue 6294005: A quick fix for Bug 69906.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/speech/audio_encoder.cc
===================================================================
--- chrome/browser/speech/audio_encoder.cc (revision 71616)
+++ chrome/browser/speech/audio_encoder.cc (working copy)
@@ -109,7 +109,8 @@
class SpeexEncoder : public speech_input::AudioEncoder {
public:
- SpeexEncoder(int sampling_rate);
+ explicit SpeexEncoder(int sampling_rate);
+ virtual ~SpeexEncoder();
virtual void Encode(const short* samples, int num_samples);
virtual void Flush() {}
@@ -138,6 +139,11 @@
memset(encoded_frame_data_, 0, sizeof(encoded_frame_data_));
}
+SpeexEncoder::~SpeexEncoder() {
+ speex_bits_destroy(&bits_);
+ speex_encoder_destroy(encoder_state_);
+}
+
void SpeexEncoder::Encode(const short* samples, int num_samples) {
// Drop incomplete frames, typically those which come in when recording stops.
num_samples -= (num_samples % samples_per_frame_);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698