From ca21c93f6641cbe68eea44b41ca8a81e10a656ad Mon Sep 17 00:00:00 2001 From: Edwin Wong Date: Thu, 27 Sep 2012 13:54:51 -0700 Subject: [PATCH] Revert "When Running in MediaCodec Mode, Widevine Freezes If You Rewind" This reverts commit 2e0e32f9f7ba1973beb377878651db06f526d7c3 Change-Id: I1362839633bca4260d83f470a780d93b8de431ca related-to-bug: 7216099 related-to-bug: 7223566 --- proprietary/wvm/WVMMediaSource.cpp | 13 ++----------- proprietary/wvm/include/WVMMediaSource.h | 6 +++--- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/proprietary/wvm/WVMMediaSource.cpp b/proprietary/wvm/WVMMediaSource.cpp index 434de1f6..e42e63c7 100644 --- a/proprietary/wvm/WVMMediaSource.cpp +++ b/proprietary/wvm/WVMMediaSource.cpp @@ -2,7 +2,6 @@ * Copyright (C) 2011 Google, Inc. All Rights Reserved */ -//#define LOG_NDEBUG 0 #define LOG_TAG "WVMMediaSource" #include @@ -25,7 +24,6 @@ static void _cb(int code) } status_t WVMMediaSource::sLastError = NO_ERROR; -int64_t WVMMediaSource::mLastSeekTimeUs = -1; WVMMediaSource::WVMMediaSource(WVSession *session, WVEsSelector esSelector, const sp &metaData, bool isLive, @@ -248,10 +246,8 @@ status_t WVMMediaSource::read(MediaBuffer **buffer, const ReadOptions *options) // prior to the specified time. seekNextSync = true; } else { - // Whichever stream gets the seek first should do the actual seeking. - // To keep from double-seeking, we share the information about who - // has seeked most recently. - if (mLastSeekTimeUs != seekTimeUs) { + // Let video stream control seek + if (mESSelector == WV_EsSelector_Video) { float scaleUsed; std::string when = usecToNPT(seekTimeUs) + std::string("-"); WVStatus result = WV_Play(mSession, 1.0, &scaleUsed, when ); @@ -259,11 +255,6 @@ status_t WVMMediaSource::read(MediaBuffer **buffer, const ReadOptions *options) ALOGE("WV_Play returned status %d in WVMMediaSource::read\n", result); return ERROR_IO; } - mLastSeekTimeUs = seekTimeUs; - } else { - // Now that both video and audio were seeked, clear the shared - // data. - mLastSeekTimeUs = -1; } } } diff --git a/proprietary/wvm/include/WVMMediaSource.h b/proprietary/wvm/include/WVMMediaSource.h index 44305b36..78c13009 100644 --- a/proprietary/wvm/include/WVMMediaSource.h +++ b/proprietary/wvm/include/WVMMediaSource.h @@ -69,16 +69,17 @@ 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 mTrackMetaData; @@ -93,7 +94,6 @@ private: MediaBufferGroup *mGroup; int64_t mKeyTime; - unsigned long long mDts; unsigned long long mPts;