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(); |
} |