diff options
| author | Andy Hung <hunga@google.com> | 2015-04-30 00:37:57 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-30 00:37:58 +0000 |
| commit | f3d3856f3e7b76765dfef6e94a4031c008f53b99 (patch) | |
| tree | 5071c0b9d04413b1667dd2f4af500814daaf28b6 /media/jni | |
| parent | 3f9dc836c41ef6bdf812acc1803c849389ee6294 (diff) | |
| parent | 26eca01c490f643fc2558be4c5477a1d433a8a07 (diff) | |
| download | frameworks_base-f3d3856f3e7b76765dfef6e94a4031c008f53b99.zip frameworks_base-f3d3856f3e7b76765dfef6e94a4031c008f53b99.tar.gz frameworks_base-f3d3856f3e7b76765dfef6e94a4031c008f53b99.tar.bz2 | |
Merge "Check for null codec from AMediaCodec_createDecoderByType" into mnc-dev
Diffstat (limited to 'media/jni')
| -rw-r--r-- | media/jni/soundpool/SoundPool.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/media/jni/soundpool/SoundPool.cpp b/media/jni/soundpool/SoundPool.cpp index 25c6154..84ae3b4 100644 --- a/media/jni/soundpool/SoundPool.cpp +++ b/media/jni/soundpool/SoundPool.cpp @@ -514,10 +514,11 @@ static status_t decode(int fd, int64_t offset, int64_t length, if (strncmp(mime, "audio/", 6) == 0) { AMediaCodec *codec = AMediaCodec_createDecoderByType(mime); - if (AMediaCodec_configure(codec, format, - NULL /* window */, NULL /* drm */, 0 /* flags */) != AMEDIA_OK - || AMediaCodec_start(codec) != AMEDIA_OK - || AMediaExtractor_selectTrack(ex, i) != AMEDIA_OK) { + if (codec == NULL + || AMediaCodec_configure(codec, format, + NULL /* window */, NULL /* drm */, 0 /* flags */) != AMEDIA_OK + || AMediaCodec_start(codec) != AMEDIA_OK + || AMediaExtractor_selectTrack(ex, i) != AMEDIA_OK) { AMediaExtractor_delete(ex); AMediaCodec_delete(codec); AMediaFormat_delete(format); |
