summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorDave Sparks <davidsparks@android.com>2009-12-09 21:21:58 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-09 21:21:58 -0800
commitbb3e1e3b8d1caa9c673a62f08a38792b7c205364 (patch)
treec13b54347a3aac09d7f887c3f1c8542dd8e50939 /media
parentbd5c9d23d30ea665093902118bb34cf4d11e4cc8 (diff)
parent14f8940472217e8b0164d8f213679710d623d528 (diff)
downloadframeworks_base-bb3e1e3b8d1caa9c673a62f08a38792b7c205364.zip
frameworks_base-bb3e1e3b8d1caa9c673a62f08a38792b7c205364.tar.gz
frameworks_base-bb3e1e3b8d1caa9c673a62f08a38792b7c205364.tar.bz2
am 14f89404: Fix media player decode function. Bug 2317821.
Merge commit '14f8940472217e8b0164d8f213679710d623d528' into eclair-plus-aosp * commit '14f8940472217e8b0164d8f213679710d623d528': Fix media player decode function. Bug 2317821.
Diffstat (limited to 'media')
-rw-r--r--media/libmediaplayerservice/MediaPlayerService.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp
index 0a6c365..df673a4 100644
--- a/media/libmediaplayerservice/MediaPlayerService.cpp
+++ b/media/libmediaplayerservice/MediaPlayerService.cpp
@@ -1573,12 +1573,14 @@ status_t MediaPlayerService::AudioCache::open(
uint32_t sampleRate, int channelCount, int format, int bufferCount,
AudioCallback cb, void *cookie)
{
+ LOGV("open(%u, %d, %d, %d)", sampleRate, channelCount, format, bufferCount);
if (cb != NULL) {
return UNKNOWN_ERROR; // TODO: implement this.
}
+ if (mHeap->getHeapID() < 0) {
+ return NO_INIT;
+ }
- LOGV("open(%u, %d, %d, %d)", sampleRate, channelCount, format, bufferCount);
- if (mHeap->getHeapID() < 0) return NO_INIT;
mSampleRate = sampleRate;
mChannelCount = (uint16_t)channelCount;
mFormat = (uint16_t)format;
@@ -1627,16 +1629,24 @@ void MediaPlayerService::AudioCache::notify(void* cookie, int msg, int ext1, int
AudioCache* p = static_cast<AudioCache*>(cookie);
// ignore buffering messages
- if (msg == MEDIA_BUFFERING_UPDATE) return;
-
- // set error condition
- if (msg == MEDIA_ERROR) {
+ switch (msg)
+ {
+ case MEDIA_ERROR:
LOGE("Error %d, %d occurred", ext1, ext2);
p->mError = ext1;
+ break;
+ case MEDIA_PREPARED:
+ LOGV("prepared");
+ break;
+ case MEDIA_PLAYBACK_COMPLETE:
+ LOGV("playback complete");
+ break;
+ default:
+ LOGV("ignored");
+ return;
}
// wake up thread
- LOGV("wakeup thread");
p->mCommandComplete = true;
p->mSignal.signal();
}