summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2014-09-20 02:18:58 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-09-20 02:18:58 +0000
commit54c4dbda0c9590b669266a76e8397ed5ad9a7aea (patch)
tree37a0d3c20e0d251a8513eb87ec8bae397ebc9491 /media
parentc3813abf89d8a02fcaed8a13ec62dc7a3f1df2b7 (diff)
parent3bde6b1c3387c51479f39846533ead246a920990 (diff)
downloadframeworks_av-54c4dbda0c9590b669266a76e8397ed5ad9a7aea.zip
frameworks_av-54c4dbda0c9590b669266a76e8397ed5ad9a7aea.tar.gz
frameworks_av-54c4dbda0c9590b669266a76e8397ed5ad9a7aea.tar.bz2
am 3bde6b1c: Merge "Make prepare properly report failure again" into lmp-dev
* commit '3bde6b1c3387c51479f39846533ead246a920990': Make prepare properly report failure again
Diffstat (limited to 'media')
-rw-r--r--media/libmediaplayerservice/nuplayer/GenericSource.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/media/libmediaplayerservice/nuplayer/GenericSource.cpp b/media/libmediaplayerservice/nuplayer/GenericSource.cpp
index 142107d..cf9c962 100644
--- a/media/libmediaplayerservice/nuplayer/GenericSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/GenericSource.cpp
@@ -158,7 +158,12 @@ status_t NuPlayer::GenericSource::initFromDataSource() {
int32_t totalBitrate = 0;
- for (size_t i = 0; i < extractor->countTracks(); ++i) {
+ size_t numtracks = extractor->countTracks();
+ if (numtracks == 0) {
+ return UNKNOWN_ERROR;
+ }
+
+ for (size_t i = 0; i < numtracks; ++i) {
sp<MediaSource> track = extractor->getTrack(i);
sp<MetaData> meta = extractor->getTrackMetaData(i);