Bug 1005622 - Reset media queues in Android media seek so that we don't think we're still at EOS after playing to EOS and then seeking. r=edwin, a=sledru
authorChris Pearce <cpearce@mozilla.com>
Tue, 13 May 2014 09:04:56 +1200
changeset 192251 63b001b6f985
parent 192250 afcec252f3b7
child 192252 913fb15c7218
push id3545
push usercpearce@mozilla.com
push date2014-05-12 21:24 +0000
Treeherderresults
reviewersedwin, sledru
bugs1005622
milestone30.0
Bug 1005622 - Reset media queues in Android media seek so that we don't think we're still at EOS after playing to EOS and then seeking. r=edwin, a=sledru
content/media/plugins/MediaPluginReader.cpp
content/media/raw/RawReader.cpp
--- a/content/media/plugins/MediaPluginReader.cpp
+++ b/content/media/plugins/MediaPluginReader.cpp
@@ -318,18 +318,18 @@ bool MediaPluginReader::DecodeAudioData(
                                      source.mSize,
                                      source.mAudioChannels));
 }
 
 nsresult MediaPluginReader::Seek(int64_t aTarget, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime)
 {
   NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
 
-  mVideoQueue.Erase();
-  mAudioQueue.Erase();
+  mVideoQueue.Reset();
+  mAudioQueue.Reset();
 
   mAudioSeekTimeUs = mVideoSeekTimeUs = aTarget;
 
   return DecodeToTarget(aTarget);
 }
 
 MediaPluginReader::ImageBufferCallback::ImageBufferCallback(mozilla::layers::ImageContainer *aImageContainer) :
   mImageContainer(aImageContainer)
--- a/content/media/raw/RawReader.cpp
+++ b/content/media/raw/RawReader.cpp
@@ -243,17 +243,17 @@ nsresult RawReader::Seek(int64_t aTime, 
 
   CheckedUint32 offset = CheckedUint32(mCurrentFrame) * mFrameSize;
   offset += sizeof(RawVideoHeader);
   NS_ENSURE_TRUE(offset.isValid(), NS_ERROR_FAILURE);
 
   nsresult rv = resource->Seek(nsISeekableStream::NS_SEEK_SET, offset.value());
   NS_ENSURE_SUCCESS(rv, rv);
 
-  mVideoQueue.Erase();
+  mVideoQueue.Reset();
 
   while(mVideoQueue.GetSize() == 0) {
     bool keyframeSkip = false;
     if (!DecodeVideoFrame(keyframeSkip, 0)) {
       mCurrentFrame = frame;
       return NS_ERROR_FAILURE;
     }