Chromium Code Reviews| Index: content/renderer/media/rtc_video_decoder.cc |
| diff --git a/content/renderer/media/rtc_video_decoder.cc b/content/renderer/media/rtc_video_decoder.cc |
| index 0d97ab89595422ec3050d6f980634556ae782c80..512c1eacfb1df4dc36fd9363360d7dc906f36006 100644 |
| --- a/content/renderer/media/rtc_video_decoder.cc |
| +++ b/content/renderer/media/rtc_video_decoder.cc |
| @@ -237,6 +237,9 @@ int32_t RTCVideoDecoder::Decode( |
| // TODO(wuchengli): VDA should handle it. Remove this when |
| // http://crosbug.com/p/21913 is fixed. |
| DVLOG(1) << "The first frame should be a key frame. Drop this."; |
|
mcasas
2016/06/30 18:07:25
This DVLOG() goes with l.243 now.
emircan
2016/06/30 20:39:17
Done.
|
| + if (vda_error_counter_) |
| + ++vda_error_counter_; |
|
mcasas
2016/06/30 18:07:25
I'd write this instead:
// If we're are in an err
emircan
2016/06/30 20:39:17
Done.
|
| + |
| return WEBRTC_VIDEO_CODEC_ERROR; |
| } |
| @@ -269,8 +272,6 @@ int32_t RTCVideoDecoder::Decode( |
| base::AutoUnlock auto_unlock(lock_); |
| Release(); |
| } |
| - |
| - TryResetVDAErrorCounter_Locked(); |
| return WEBRTC_VIDEO_CODEC_OK; |
| } |
| @@ -279,7 +280,6 @@ int32_t RTCVideoDecoder::Decode( |
| FROM_HERE, |
| base::Bind(&RTCVideoDecoder::RequestBufferDecode, |
| weak_factory_.GetWeakPtr())); |
| - TryResetVDAErrorCounter_Locked(); |
| return WEBRTC_VIDEO_CODEC_OK; |
| } |
| @@ -444,6 +444,7 @@ void RTCVideoDecoder::PictureReady(const media::Picture& picture) { |
| decode_complete_callback_->Decoded(decoded_image); |
| } |
| } |
| + TryResetVDAErrorCounter(); |
| } |
| scoped_refptr<media::VideoFrame> RTCVideoDecoder::CreateVideoFrame( |
| @@ -889,8 +890,8 @@ void RTCVideoDecoder::ClearPendingBuffers() { |
| pending_buffers_.clear(); |
| } |
| -void RTCVideoDecoder::TryResetVDAErrorCounter_Locked() { |
| - lock_.AssertAcquired(); |
| +void RTCVideoDecoder::TryResetVDAErrorCounter() { |
| + base::AutoLock auto_lock(lock_); |
| if (vda_error_counter_ == 0) |
| return; |