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

Unified Diff: media/filters/video_renderer_impl.cc

Issue 276593007: Replace VideoRendererImpl's kError state with a CHECK(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 months 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/video_renderer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_renderer_impl.cc
diff --git a/media/filters/video_renderer_impl.cc b/media/filters/video_renderer_impl.cc
index b86f661e7a89cd639df814f8a1eb427a5dfa5a22..56dda7ba2b9949025add68846a53caab68e6229e 100644
--- a/media/filters/video_renderer_impl.cc
+++ b/media/filters/video_renderer_impl.cc
@@ -60,7 +60,7 @@ void VideoRendererImpl::Play(const base::Closure& callback) {
void VideoRendererImpl::Pause(const base::Closure& callback) {
DCHECK(task_runner_->BelongsToCurrentThread());
base::AutoLock auto_lock(lock_);
- DCHECK(state_ != kUninitialized || state_ == kError);
+ DCHECK_NE(state_, kUninitialized);
state_ = kPaused;
callback.Run();
}
@@ -212,12 +212,7 @@ void VideoRendererImpl::OnVideoFrameStreamInitialized(bool success) {
state_ = kFlushed;
// Create our video thread.
- if (!base::PlatformThread::Create(0, this, &thread_)) {
- NOTREACHED() << "Video thread creation failed";
- state_ = kError;
- base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_INITIALIZATION_FAILED);
- return;
- }
+ CHECK(base::PlatformThread::Create(0, this, &thread_));
#if defined(OS_WIN)
// Bump up our priority so our sleeping is more accurate.
@@ -363,7 +358,7 @@ void VideoRendererImpl::FrameReady(VideoFrameStream::Status status,
// Already-queued VideoFrameStream ReadCB's can fire after various state
// transitions have happened; in that case just drop those frames immediately.
- if (state_ == kStopped || state_ == kError || state_ == kFlushing)
+ if (state_ == kStopped || state_ == kFlushing)
return;
if (!frame.get()) {
@@ -468,7 +463,6 @@ void VideoRendererImpl::AttemptRead_Locked() {
case kFlushing:
case kFlushed:
case kStopped:
- case kError:
return;
}
}
« no previous file with comments | « media/filters/video_renderer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698