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

Unified Diff: media/filters/decoder_stream.cc

Issue 490033002: Don't try to decode more than one EOS at a time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
« media/filters/decoder_stream.h ('K') | « media/filters/decoder_stream.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/decoder_stream.cc
diff --git a/media/filters/decoder_stream.cc b/media/filters/decoder_stream.cc
index 45172901410c22f0f03977224e00f774fe119afc..9f44402a1c78da070eabd0a01cfd82886d52ea88 100644
--- a/media/filters/decoder_stream.cc
+++ b/media/filters/decoder_stream.cc
@@ -52,6 +52,7 @@ DecoderStream<StreamType>::DecoderStream(
decoders.Pass(),
set_decryptor_ready_cb)),
active_splice_(false),
+ decoding_eos_(false),
pending_decode_requests_(0),
weak_factory_(this) {}
@@ -207,7 +208,7 @@ bool DecoderStream<StreamType>::CanDecodeMore() const {
// empty.
int num_decodes =
static_cast<int>(ready_outputs_.size()) + pending_decode_requests_;
- return num_decodes < GetMaxDecodeRequests();
+ return !decoding_eos_ && num_decodes < GetMaxDecodeRequests();
}
template <DemuxerStream::Type StreamType>
@@ -265,6 +266,9 @@ void DecoderStream<StreamType>::Decode(
weak_factory_.GetWeakPtr(),
buffer_size,
buffer->end_of_stream()));
+
+ if (buffer->end_of_stream())
+ decoding_eos_ = true;
}
template <DemuxerStream::Type StreamType>
@@ -286,6 +290,9 @@ void DecoderStream<StreamType>::OnDecodeDone(int buffer_size,
TRACE_EVENT_ASYNC_END0("media", GetTraceString<StreamType>(), this);
+ if (end_of_stream)
+ decoding_eos_ = false;
+
if (state_ == STATE_ERROR) {
DCHECK(read_cb_.is_null());
return;
« media/filters/decoder_stream.h ('K') | « media/filters/decoder_stream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698