When Running in MediaCodec Mode, Widevine Freezes If You Rewind

There was a subtle interaction between Widevine's libraries and MediaCodec
mode.  Widevine's code assumed (erroneously) that video seeks would always
happen before audio seeks, and because we can't seek audio and video
independently from each other, we would ignore audio seeks but respect video
seeks.  This led to a problem since MediaCodec mode calls seeks in arbitrary
order.

Fix is to always respect the first request we get to seek and ignore the
second.

Bug: 6793514
Change-Id: Ic9ec60e0e0f606c7a0de6283dd4c30318eebdbad
This commit is contained in:
John "Juce" Bruce
2012-09-10 18:42:48 -07:00
committed by edwinwong
parent 38e5d5912c
commit 2e0e32f9f7
2 changed files with 14 additions and 5 deletions

View File

@@ -69,17 +69,16 @@ public:
memcpy(mCryptoPluginKey, key, sizeof(mCryptoPluginKey));
}
private:
DecryptContext mDecryptContext;
protected:
virtual ~WVMMediaSource();
private:
static int64_t mLastSeekTimeUs;
Mutex mLock;
WVSession *mSession;
WVEsSelector mESSelector; // indicates audio vs. video
DecryptContext mDecryptContext;
sp<MetaData> mTrackMetaData;
@@ -94,6 +93,7 @@ private:
MediaBufferGroup *mGroup;
int64_t mKeyTime;
unsigned long long mDts;
unsigned long long mPts;