Fix native fault in WVMMediaSource::DecryptCallback
This change resolves a lifetime issue between the media extractor and media sources. The extractor was being passed as a context object to a callout in the WV libs. In some cases, a pointer to the extractor would be delivered to the callout after the extractor had been released. This change assigns the responsibility of the lifetime of the context object to the media source, to ensure that a ref is always held on the context object during the lifetime of the media source. Change-Id: Ic7a57a1c8496a4798fe590ec356b8a19a4f69967 related-to-bug: 6502322
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <media/stagefright/MetaData.h>
|
||||
#include <media/stagefright/MediaBufferGroup.h>
|
||||
#include <utils/RefBase.h>
|
||||
#include "ClientContext.h"
|
||||
#ifdef REQUIRE_SECURE_BUFFERS
|
||||
#include "OEMCrypto_L1.h"
|
||||
#endif
|
||||
@@ -29,6 +30,7 @@ public:
|
||||
|
||||
void delegateFileSource(sp<WVMFileSource> fileSource);
|
||||
void delegateDataSource(sp<DataSource> dataSource);
|
||||
void delegateClientContext(sp<ClientContext> context);
|
||||
|
||||
virtual status_t start(MetaData *params = NULL);
|
||||
virtual status_t stop();
|
||||
@@ -87,6 +89,7 @@ private:
|
||||
|
||||
sp<WVMFileSource> mFileSource;
|
||||
sp<DataSource> mDataSource;
|
||||
sp<ClientContext> mClientContext;
|
||||
|
||||
Vector<size_t> mEncryptedSizes;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user