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

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: Move comment to video_decoder.h 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
« no previous file with comments | « media/filters/decoder_stream.h ('k') | media/filters/fake_video_decoder.cc » ('j') | 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..de7a23da040109c4ac048b568da19dd458aeb73d 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())
acolwell GONE FROM CHROMIUM 2014/08/27 00:44:39 nit: Shouldn't this be before the Decode() call ju
sandersd (OOO until July 31) 2014/08/27 01:13:45 Decode() is defined not to do that, but seems like
+ 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;
acolwell GONE FROM CHROMIUM 2014/08/27 00:44:39 Is there any reason not to simply make this a STAT
sandersd (OOO until July 31) 2014/08/27 01:13:45 This is true, but I was having trouble proving tha
acolwell GONE FROM CHROMIUM 2014/08/27 01:49:47 OK. I don't think it is worth holding things up ri
sandersd (OOO until July 31) 2014/08/27 21:45:59 Done.
+
if (state_ == STATE_ERROR) {
DCHECK(read_cb_.is_null());
return;
@@ -447,7 +454,7 @@ void DecoderStream<StreamType>::OnBufferReady(
Decode(buffer);
// Read more data if the decoder supports multiple parallel decoding requests.
- if (CanDecodeMore() && !buffer->end_of_stream())
+ if (CanDecodeMore())
ReadFromDemuxerStream();
}
« no previous file with comments | « media/filters/decoder_stream.h ('k') | media/filters/fake_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698