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

Unified Diff: media/filters/decoder_base.h

Issue 151170: Fix a bug in audio/video decoder that the stopped variable is not initialized... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 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: media/filters/decoder_base.h
===================================================================
--- media/filters/decoder_base.h (revision 19701)
+++ media/filters/decoder_base.h (working copy)
@@ -80,7 +80,7 @@
// within the OnDecode method.
void EnqueueResult(Output* output) {
DCHECK_EQ(PlatformThread::CurrentId(), thread_id_);
- if (!stopped_) {
+ if (!IsStopped()) {
result_queue_.push_back(output);
}
}
@@ -122,6 +122,7 @@
// TODO(scherkus): another reason to add protected accessors to MediaFilter.
FilterHost* host() const { return Decoder::host_; }
MessageLoop* message_loop() const { return Decoder::message_loop_; }
+ bool IsStopped() { return state_ == STOPPED; }
void StopTask() {
DCHECK_EQ(PlatformThread::CurrentId(), thread_id_);
@@ -171,7 +172,7 @@
void ReadTask(ReadCallback* read_callback) {
DCHECK_EQ(PlatformThread::CurrentId(), thread_id_);
// TODO(scherkus): should reply with a null operation (empty buffer).
- if (stopped_) {
+ if (IsStopped()) {
delete read_callback;
return;
}
@@ -191,7 +192,7 @@
DCHECK_EQ(PlatformThread::CurrentId(), thread_id_);
DCHECK_GT(pending_reads_, 0u);
--pending_reads_;
- if (stopped_) {
+ if (IsStopped()) {
return;
}
@@ -250,10 +251,6 @@
// Using size_t since it is always compared against deque::size().
size_t pending_reads_;
- // If true, then Stop() has been called and no further processing of buffers
- // should occur.
- bool stopped_;
-
// An internal state of the decoder that indicates that are waiting for seek
// to complete. We expect to receive a discontinuous frame/packet from the
// demuxer to signal that seeking is completed.
« 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