Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(908)

Unified Diff: media/filters/decrypting_video_decoder.cc

Issue 11420070: Remove locking from FFmpegDemuxerStream and associated TODOs from media code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/decrypting_video_decoder.h ('k') | media/filters/ffmpeg_audio_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
- // 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;
« no previous file with comments | « media/filters/decrypting_video_decoder.h ('k') | media/filters/ffmpeg_audio_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698