summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2014-05-27 22:43:05 +0300
committerMartin Storsjo <martin@martin.st>2014-05-27 22:43:05 +0300
commit36c0711b6919c2185a4d6e514d7f421b0d9c7bc6 (patch)
tree1240ff167e34601f40069e2e5d9ac31f617b38f0 /src
parenta62c3572e60ae0446632de15418a65089cccf551 (diff)
downloadandroid_frameworks_wilhelm-36c0711b6919c2185a4d6e514d7f421b0d9c7bc6.tar.gz
android_frameworks_wilhelm-36c0711b6919c2185a4d6e514d7f421b0d9c7bc6.tar.bz2
android_frameworks_wilhelm-36c0711b6919c2185a4d6e514d7f421b0d9c7bc6.zip
Check that the ABQ mime type matches the expectations
The code in audioPlayer_getAndroidObjectTypeForSourceSink assumes that an android buffer queue source combined with an output mix sink is an mpegts source, while it it assumes that it is an adts source if it is combined with a simple buffer queue sink. This assumption never was verified before, making the set up actually seem to succeed even though the data is interpreted as the wrong format. Change-Id: I7e031ec8139fa2d770737935eb9acd3506d3fa3f
Diffstat (limited to 'src')
-rw-r--r--src/android/AudioPlayer_to_android.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/android/AudioPlayer_to_android.cpp b/src/android/AudioPlayer_to_android.cpp
index d72cf4b..04895b9 100644
--- a/src/android/AudioPlayer_to_android.cpp
+++ b/src/android/AudioPlayer_to_android.cpp
@@ -1037,6 +1037,10 @@ SLresult android_audioPlayer_checkSourceSink(CAudioPlayer *pAudioPlayer)
(char*)df_mime->mimeType, XA_ANDROID_MIME_MP2TS);
return SL_RESULT_CONTENT_UNSUPPORTED;
}
+ if (pAudioPlayer->mAndroidObjType != AUDIOPLAYER_FROM_TS_ANDROIDBUFFERQUEUE) {
+ SL_LOGE("Invalid sink for container SL_CONTAINERTYPE_MPEG_TS");
+ return SL_RESULT_PARAMETER_INVALID;
+ }
break;
case SL_CONTAINERTYPE_RAW:
case SL_CONTAINERTYPE_AAC:
@@ -1048,6 +1052,10 @@ SLresult android_audioPlayer_checkSourceSink(CAudioPlayer *pAudioPlayer)
SL_ANDROID_MIME_AACADTS);
return SL_RESULT_CONTENT_UNSUPPORTED;
}
+ if (pAudioPlayer->mAndroidObjType != AUDIOPLAYER_FROM_ADTS_ABQ_TO_PCM_BUFFERQUEUE) {
+ SL_LOGE("Invalid sink for container SL_CONTAINERTYPE_AAC");
+ return SL_RESULT_PARAMETER_INVALID;
+ }
break;
default:
SL_LOGE("Cannot create player with SL_DATALOCATOR_ANDROIDBUFFERQUEUE data source "