Chromium Code Reviews| Index: media/filters/decrypting_video_decoder.cc |
| diff --git a/media/filters/decrypting_video_decoder.cc b/media/filters/decrypting_video_decoder.cc |
| index 72fcd8bda002b82a9a441395c6d733f620f508a8..48e81d09b59db5a182416a5808e223074dfe4d9b 100644 |
| --- a/media/filters/decrypting_video_decoder.cc |
| +++ b/media/filters/decrypting_video_decoder.cc |
| @@ -235,26 +235,20 @@ void DecryptingVideoDecoder::ReadFromDemuxerStream() { |
| DCHECK(!read_cb_.is_null()); |
| demuxer_stream_->Read( |
| - base::Bind(&DecryptingVideoDecoder::DecryptAndDecodeBuffer, this)); |
| -} |
| - |
| -void DecryptingVideoDecoder::DecryptAndDecodeBuffer( |
| - DemuxerStream::Status status, |
| - const scoped_refptr<DecoderBuffer>& buffer) { |
| - // In theory, we don't need to force post the task here, because we do a |
|
scherkus (not reviewing)
2012/11/19 19:11:16
xhwang: ditto
|
| - // force task post in DeliverFrame(). Therefore, even if |
| - // demuxer_stream_->Read() execute the read callback on the same execution |
| - // stack we are still fine. But it looks like a force post task makes the |
| - // logic more understandable and manageable, so why not? |
| - message_loop_->PostTask(FROM_HERE, base::Bind( |
| - &DecryptingVideoDecoder::DoDecryptAndDecodeBuffer, this, status, buffer)); |
| + base::Bind(&DecryptingVideoDecoder::DoDecryptAndDecodeBuffer, this)); |
| } |
| void DecryptingVideoDecoder::DoDecryptAndDecodeBuffer( |
| DemuxerStream::Status status, |
| const scoped_refptr<DecoderBuffer>& buffer) { |
| + if (!message_loop_->BelongsToCurrentThread()) { |
| + message_loop_->PostTask(FROM_HERE, base::Bind( |
| + &DecryptingVideoDecoder::DoDecryptAndDecodeBuffer, this, |
| + status, buffer)); |
| + return; |
| + } |
| + |
| DVLOG(3) << "DoDecryptAndDecodeBuffer()"; |
| - DCHECK(message_loop_->BelongsToCurrentThread()); |
| if (state_ == kStopped) |
| return; |