| Index: content/common/gpu/media/vaapi_video_decode_accelerator.cc
|
| diff --git a/content/common/gpu/media/vaapi_video_decode_accelerator.cc b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
|
| index 2d638cbcb565ee632b7db0947df44818c9e94f44..d8c3b31bf9217fb21035886baa755612cf4019b0 100644
|
| --- a/content/common/gpu/media/vaapi_video_decode_accelerator.cc
|
| +++ b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
|
| @@ -249,6 +249,7 @@ VaapiVideoDecodeAccelerator::VaapiVideoDecodeAccelerator(
|
| finish_flush_pending_(false),
|
| awaiting_va_surfaces_recycle_(false),
|
| requested_num_pics_(0),
|
| + min_picture_count_(0),
|
| bind_image_(bind_image),
|
| weak_this_factory_(this) {
|
| weak_this_ = weak_this_factory_.GetWeakPtr();
|
| @@ -261,6 +262,7 @@ VaapiVideoDecodeAccelerator::~VaapiVideoDecodeAccelerator() {
|
| }
|
|
|
| bool VaapiVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile,
|
| + uint32 min_picture_count,
|
| Client* client) {
|
| DCHECK_EQ(message_loop_, base::MessageLoop::current());
|
|
|
| @@ -308,6 +310,7 @@ bool VaapiVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile,
|
|
|
| CHECK(decoder_thread_.Start());
|
| decoder_thread_task_runner_ = decoder_thread_.task_runner();
|
| + min_picture_count_ = min_picture_count;
|
|
|
| state_ = kIdle;
|
| return true;
|
| @@ -508,7 +511,9 @@ void VaapiVideoDecodeAccelerator::DecodeTask() {
|
| DVLOG(1) << "Decoder requesting a new set of surfaces";
|
| message_loop_->PostTask(FROM_HERE, base::Bind(
|
| &VaapiVideoDecodeAccelerator::InitiateSurfaceSetChange, weak_this_,
|
| - decoder_->GetRequiredNumOfPictures(),
|
| + std::max(min_picture_count_,
|
| + static_cast<uint32_t>(
|
| + decoder_->GetRequiredNumOfPictures())),
|
| decoder_->GetPicSize()));
|
| // We'll get rescheduled once ProvidePictureBuffers() finishes.
|
| return;
|
|
|