Fix HLS Live Playback with Widevine DRM.

In WVMExtractorImpl.cpp, a structure of type WVCallbacks was not initialized.
In version 4.5.0 of the Widevine library, this is just a struct (not a class)
so it does not have a constructor method.  This record was being set with
garbage default values and was causing problems setting up playback.  This may
have caused other stability issues after we reverted to 4.5.0.  In the future,
when we push forward to version 6.0 of the Widevine library, this change should
be removed.

In WVMediaSource.cpp, a flag was set to strip off the ATDS headers.  This was
redundent, and causing seg faults, for live stream.

related-to-bug: 6454710

Change-Id: I3edeb40c731021b2f31f639416188d4a1c002cc5
This commit is contained in:
Fred Gylys-Colwell
2012-05-16 16:03:19 -07:00
parent 79e250e999
commit ff793bcaf0
2 changed files with 14 additions and 19 deletions

View File

@@ -132,23 +132,17 @@ void WVMExtractorImpl::Initialize()
mIsLiveStream = (mDataSource->getUri().getPathExtension().find(".m3u8") == 0);
}
WVCallbacks callbacks;
// The following memset is needed for 4.5.0 only, because WVCallbacks is a struct.
memset( &callbacks, 0, sizeof(callbacks));
callbacks.socketInfo = SocketInfoCallback;
#ifdef REQUIRE_SECURE_BUFFERS
if (!mIsLiveStream) {
//ALOGD("WVMExtractorImpl::Initialize setting DecryptCallback\n");
WVCallbacks callbacks;
callbacks.decrypt = WVMMediaSource::DecryptCallback;
callbacks.socketInfo = SocketInfoCallback;
result = WV_Initialize(&callbacks);
} else {
WVCallbacks callbacks;
callbacks.socketInfo = SocketInfoCallback;
result = WV_Initialize(&callbacks);
}
#else
WVCallbacks callbacks;
callbacks.socketInfo = SocketInfoCallback;
result = WV_Initialize(&callbacks);
#endif
result = WV_Initialize(&callbacks);
if (result != WV_Status_OK) {
ALOGE("WV_Initialize returned status %d\n", result);
@@ -551,4 +545,3 @@ void WVMExtractorImpl::setUID(uid_t uid)
}
} // namespace android

View File

@@ -163,14 +163,16 @@ sp<MetaData> WVMMediaSource::getFormat()
Mutex::Autolock autoLock(mLock);
#ifdef REQUIRE_SECURE_BUFFERS
if (!mIsLiveStream && (mESSelector == WV_EsSelector_Video)) {
mTrackMetaData->setInt32(kKeyRequiresSecureBuffers, true);
}
if (!mIsLiveStream) {
if (mESSelector == WV_EsSelector_Video) {
mTrackMetaData->setInt32(kKeyRequiresSecureBuffers, true);
}
// Only support AAC on android for now, so assume the audio
// track is AAC and notify the audio codec it has ADTS framing
if (mESSelector == WV_EsSelector_Audio) {
mTrackMetaData->setInt32(kKeyIsADTS, 1);
// Only support AAC on android for now, so assume the audio
// track is AAC and notify the audio codec it has ADTS framing
if (mESSelector == WV_EsSelector_Audio) {
mTrackMetaData->setInt32(kKeyIsADTS, 1);
}
}
#endif