summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-12-28 01:59:36 -0800
committerSteve Kondik <steve@cyngn.com>2015-12-28 02:19:26 -0800
commit020adf202a6a485808a686566cb10e7549ac4cf1 (patch)
treecf2f4c129b38412ff0893228382e18fd3742b754 /media/libmediaplayerservice
parent4adc18316df05e7a4c3bd246774fa66d72b1ced9 (diff)
downloadframeworks_av-020adf202a6a485808a686566cb10e7549ac4cf1.zip
frameworks_av-020adf202a6a485808a686566cb10e7549ac4cf1.tar.gz
frameworks_av-020adf202a6a485808a686566cb10e7549ac4cf1.tar.bz2
nuplayer: Pass along the sniffed metadata from GenericSource
* When the extended sniffer detects a file type that only it can handle, it will set a flag in the metadata. In some cases, an extractor exists in Android already for the filetype however it may be known to fail or we may want different behavior. * This flag is checked in MediaExtractor, but GenericSource does a little dance in order to stack DataSources for DRM and was throwing out this metadata (it's not really used by AOSP), so the desired behavior was not seen for some cases. * Add a new optional argument when creating the MediaExtractor to pass in the metadata from the original sniff so that the extended extractor is used where necessary for streaming formats. * This fixes FLAC offload with Tidal. Change-Id: I7d6b875346ce63b60cd3c37572b779665bfe217c
Diffstat (limited to 'media/libmediaplayerservice')
-rw-r--r--media/libmediaplayerservice/nuplayer/GenericSource.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/media/libmediaplayerservice/nuplayer/GenericSource.cpp b/media/libmediaplayerservice/nuplayer/GenericSource.cpp
index e380f0a..beda8bd 100644
--- a/media/libmediaplayerservice/nuplayer/GenericSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/GenericSource.cpp
@@ -141,14 +141,14 @@ status_t NuPlayer::GenericSource::initFromDataSource() {
sp<MediaExtractor> extractor;
String8 mimeType;
float confidence;
- sp<AMessage> dummy;
+ sp<AMessage> meta;
bool isWidevineStreaming = false;
CHECK(mDataSource != NULL);
if (mIsWidevine) {
isWidevineStreaming = SniffWVM(
- mDataSource, &mimeType, &confidence, &dummy);
+ mDataSource, &mimeType, &confidence, &meta);
if (!isWidevineStreaming ||
strcasecmp(
mimeType.string(), MEDIA_MIMETYPE_CONTAINER_WVM)) {
@@ -161,7 +161,7 @@ status_t NuPlayer::GenericSource::initFromDataSource() {
Mutex::Autolock _l(mSourceLock);
dataSource = mDataSource;
}
- if (!dataSource->sniff(&mimeType, &confidence, &dummy)) {
+ if (!dataSource->sniff(&mimeType, &confidence, &meta)) {
return UNKNOWN_ERROR;
}
isWidevineStreaming = !strcasecmp(
@@ -186,7 +186,7 @@ status_t NuPlayer::GenericSource::initFromDataSource() {
#endif
extractor = MediaExtractor::Create(mDataSource,
mimeType.isEmpty() ? NULL : mimeType.string(),
- mIsStreaming ? 0 : flags);
+ mIsStreaming ? 0 : flags, &meta);
}
if (extractor == NULL) {