Chromium Code Reviews| Index: content/common/gpu/media/video_decode_accelerator_unittest.cc |
| diff --git a/content/common/gpu/media/video_decode_accelerator_unittest.cc b/content/common/gpu/media/video_decode_accelerator_unittest.cc |
| index 8b89d049b9339115a642f008e93f3796be83eb12..237bc2321ca82d5a538760f54b8eb5672bf3a995 100644 |
| --- a/content/common/gpu/media/video_decode_accelerator_unittest.cc |
| +++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc |
| @@ -546,7 +546,13 @@ void GLRenderingVDAClient::NotifyEndOfBitstreamBuffer( |
| // VaapiVideoDecodeAccelerator::FinishReset()). |
| ++num_done_bitstream_buffers_; |
| --outstanding_decodes_; |
| - if (decode_calls_per_second_ == 0) |
| + |
| + // flush decoder after all BitstreamBuffer are processed |
|
Pawel Osciak
2015/01/20 02:18:00
Comments should be full English sentences when pos
|
| + if (encoded_data_next_pos_to_decode_ == encoded_data_.size() && |
| + outstanding_decodes_ == 0) { |
|
Pawel Osciak
2015/01/20 02:18:00
If the issue is with the decode being slow, should
Owen Lin
2015/01/20 02:43:00
The issue happens only when |decode_calls_per_seco
|
| + decoder_->Flush(); |
| + SetState(CS_FLUSHING); |
| + } else if (decode_calls_per_second_ == 0) |
| DecodeNextFragment(); |
| } |
| @@ -742,13 +748,9 @@ static bool FragmentHasConfigInfo(const uint8* data, size_t size, |
| void GLRenderingVDAClient::DecodeNextFragment() { |
| if (decoder_deleted()) |
| return; |
| - if (encoded_data_next_pos_to_decode_ == encoded_data_.size()) { |
| - if (outstanding_decodes_ == 0) { |
| - decoder_->Flush(); |
| - SetState(CS_FLUSHING); |
| - } |
| + if (encoded_data_next_pos_to_decode_ == encoded_data_.size()) |
| return; |
| - } |
| + |
| size_t end_pos; |
| std::string next_fragment_bytes; |
| if (encoded_data_next_pos_to_decode_ == 0) { |