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

Unified Diff: media/filters/ffmpeg_audio_decoder.cc

Issue 395703002: Fold {Audio|Video}Decoder::Stop() into the dtor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only Created 6 years, 5 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/ffmpeg_audio_decoder.h ('k') | media/filters/ffmpeg_video_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_audio_decoder.cc
diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc
index 28347acb52e6ec971eac58b5b2ab5f9f98169870..b45b9401b56d79dee342fd90113002acc6cbaaf1 100644
--- a/media/filters/ffmpeg_audio_decoder.cc
+++ b/media/filters/ffmpeg_audio_decoder.cc
@@ -135,9 +135,12 @@ FFmpegAudioDecoder::FFmpegAudioDecoder(
}
FFmpegAudioDecoder::~FFmpegAudioDecoder() {
- DCHECK_EQ(state_, kUninitialized);
- DCHECK(!codec_context_);
- DCHECK(!av_frame_);
+ DCHECK(task_runner_->BelongsToCurrentThread());
+
+ if (state_ != kUninitialized) {
+ ReleaseFFmpegResources();
+ ResetTimestampState();
+ }
}
void FFmpegAudioDecoder::Initialize(const AudioDecoderConfig& config,
@@ -192,17 +195,6 @@ void FFmpegAudioDecoder::Reset(const base::Closure& closure) {
task_runner_->PostTask(FROM_HERE, closure);
}
-void FFmpegAudioDecoder::Stop() {
- DCHECK(task_runner_->BelongsToCurrentThread());
-
- if (state_ == kUninitialized)
- return;
-
- ReleaseFFmpegResources();
- ResetTimestampState();
- state_ = kUninitialized;
-}
-
void FFmpegAudioDecoder::DecodeBuffer(
const scoped_refptr<DecoderBuffer>& buffer,
const DecodeCB& decode_cb) {
« no previous file with comments | « media/filters/ffmpeg_audio_decoder.h ('k') | media/filters/ffmpeg_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698