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

Unified Diff: media/filters/decoder_selector.cc

Issue 397953007: Fold DecryptingDemuxerStream::Stop() into the dtor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: media/filters/decoder_selector.cc
diff --git a/media/filters/decoder_selector.cc b/media/filters/decoder_selector.cc
index 077aed0d80b0a8fa889ae4c1671934c9eb740b46..1c5dba6acbe8c182ae54be33dfc6293e002d369c 100644
--- a/media/filters/decoder_selector.cc
+++ b/media/filters/decoder_selector.cc
@@ -116,32 +116,16 @@ void DecoderSelector<StreamType>::Abort() {
DVLOG(2) << __FUNCTION__;
DCHECK(task_runner_->BelongsToCurrentThread());
- // This could happen when SelectDecoder() was not called or when
- // |select_decoder_cb_| was already posted but not fired (e.g. in the
- // message loop queue).
- if (select_decoder_cb_.is_null())
- return;
-
- // We must be trying to initialize the |decoder_| or the
+ // We could be trying to initialize the |decoder_| or the
scherkus (not reviewing) 2014/07/17 02:23:05 nit: reflow comment?
xhwang 2014/07/17 05:00:58 Done.
// |decrypted_stream_|. Invalid all weak pointers so that all initialization
// callbacks won't fire.
weak_ptr_factory_.InvalidateWeakPtrs();
- if (decoder_) {
- // |decrypted_stream_| is either NULL or already initialized. We don't
- // need to Stop() |decrypted_stream_| in either case.
- decoder_.reset();
- ReturnNullDecoder();
- return;
- }
+ decoder_.reset();
+ decrypted_stream_.reset();
- if (decrypted_stream_) {
- decrypted_stream_->Stop();
+ if (!select_decoder_cb_.is_null())
ReturnNullDecoder();
- return;
- }
-
- NOTREACHED();
}
template <DemuxerStream::Type StreamType>

Powered by Google App Engine
This is Rietveld 408576698