diff options
| author | 2009-12-10 23:46:11 -0800 | |
|---|---|---|
| committer | 2009-12-10 23:46:11 -0800 | |
| commit | 8bc1800dba1f01ad083d79ceed33eb27e49d38ac (patch) | |
| tree | 5333442cc102ec067aaae0f4dd01804451493f76 | |
| parent | 16d3fa24ab19701f486aa37eb8085680b1256ade (diff) | |
| parent | f63779b392275265b3b13728c78a0a5f4ac10c01 (diff) | |
am f63779b3: am 9472b35b: am 14f89404: Fix media player decode function. Bug 2317821.
Merge commit 'f63779b392275265b3b13728c78a0a5f4ac10c01'
* commit 'f63779b392275265b3b13728c78a0a5f4ac10c01':
Fix media player decode function. Bug 2317821.
| -rw-r--r-- | media/libmediaplayerservice/MediaPlayerService.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp index a4e3601cdf93..540d4ba0e91c 100644 --- a/media/libmediaplayerservice/MediaPlayerService.cpp +++ b/media/libmediaplayerservice/MediaPlayerService.cpp @@ -1605,12 +1605,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; @@ -1659,16 +1661,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(); } |