Index: media/base/pipeline.cc |
=================================================================== |
--- media/base/pipeline.cc (revision 150598) |
+++ media/base/pipeline.cc (working copy) |
@@ -151,6 +151,7 @@ |
case kSeeking: |
case kStarting: |
case kStarted: |
+ case kEnded: |
return true; |
default: |
return false; |
@@ -795,7 +796,7 @@ |
DCHECK(!IsPipelineStopPending()); |
// Suppress seeking if we're not fully started. |
- if (state_ != kStarted) { |
+ if (state_ != kStarted && state_ != kEnded) { |
// TODO(scherkus): should we run the callback? I'm tempted to say the API |
// will only execute the first Seek() request. |
DVLOG(1) << "Media pipeline has not started, ignoring seek to " |
@@ -808,7 +809,7 @@ |
// We'll need to pause every filter before seeking. The state transition |
// is as follows: |
- // kStarted |
+ // kStarted/kEnded |
// kPausing (for each filter) |
// kSeeking (for each filter) |
// kStarting (for each filter) |
@@ -853,6 +854,8 @@ |
return; |
} |
+ // Transition to ended, executing the callback if present. |
+ SetState(kEnded); |
{ |
base::AutoLock auto_lock(lock_); |
clock_->EndOfStream(); |
@@ -987,6 +990,7 @@ |
case kStarting: |
case kStopped: |
case kStarted: |
+ case kEnded: |
NOTREACHED() << "Unexpected state for teardown: " << state_; |
break; |
// default: intentionally left out to force new states to cause compiler |
@@ -1215,6 +1219,7 @@ |
break; |
case kStarted: |
+ case kEnded: |
SetState(kPausing); |
DoPause(base::Bind(&Pipeline::OnTeardownStateTransition, this)); |
break; |