summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-01-05 10:54:55 -0800
committerAndreas Huber <andih@google.com>2010-01-05 10:54:55 -0800
commit717826ececd8d39596f62418677721d70776add1 (patch)
tree81bcf31fd24decd26f03f921230a509b4de18b34 /media
parentb8f92e8fc059693f0b857a185a183f618c4defb0 (diff)
downloadframeworks_av-717826ececd8d39596f62418677721d70776add1.zip
frameworks_av-717826ececd8d39596f62418677721d70776add1.tar.gz
frameworks_av-717826ececd8d39596f62418677721d70776add1.tar.bz2
I must have broken raw-audio decoding in the recent past, this fixes it.
related-to-bug: http://b/issue?id=2352199
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/AwesomePlayer.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index 9e388f9..6bcdfba 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -26,11 +26,13 @@
#include <media/stagefright/DataSource.h>
#include <media/stagefright/FileSource.h>
#include <media/stagefright/MediaBuffer.h>
+#include <media/stagefright/MediaDefs.h>
#include <media/stagefright/MediaExtractor.h>
#include <media/stagefright/MediaDebug.h>
#include <media/stagefright/MediaSource.h>
#include <media/stagefright/MetaData.h>
#include <media/stagefright/OMXCodec.h>
+
namespace android {
struct AwesomeEvent : public TimedEventQueue::Event {
@@ -516,10 +518,19 @@ status_t AwesomePlayer::setAudioSource(const sp<MediaSource> &source) {
return UNKNOWN_ERROR;
}
- mAudioSource = OMXCodec::Create(
- mClient.interface(), source->getFormat(),
- false, // createEncoder
- source);
+ sp<MetaData> meta = source->getFormat();
+
+ const char *mime;
+ CHECK(meta->findCString(kKeyMIMEType, &mime));
+
+ if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_RAW)) {
+ mAudioSource = source;
+ } else {
+ mAudioSource = OMXCodec::Create(
+ mClient.interface(), source->getFormat(),
+ false, // createEncoder
+ source);
+ }
if (mAudioSource != NULL) {
int64_t durationUs;