summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorVineeta Srivastava <vsrivastava@google.com>2013-05-30 19:48:25 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-05-30 19:48:25 +0000
commita40cc472d26e36a23d00078cb925c3889d1fc0a0 (patch)
treee41f59fcb7fd27d015cd21e36c38ef60b1751cab /media
parentfe7e0c6154309f2491463ee6ca4920d225289638 (diff)
parent776a0023f5146423e88474c35691eb0e20fc8102 (diff)
downloadframeworks_av-a40cc472d26e36a23d00078cb925c3889d1fc0a0.zip
frameworks_av-a40cc472d26e36a23d00078cb925c3889d1fc0a0.tar.gz
frameworks_av-a40cc472d26e36a23d00078cb925c3889d1fc0a0.tar.bz2
Merge "libstagefright: Check for duration > 0 to avoid divide-by-zero exception"
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/AwesomePlayer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index bd28118..6c197e2 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -597,7 +597,7 @@ void AwesomePlayer::notifyListener_l(int msg, int ext1, int ext2) {
bool AwesomePlayer::getBitrate(int64_t *bitrate) {
off64_t size;
- if (mDurationUs >= 0 && mCachedSource != NULL
+ if (mDurationUs > 0 && mCachedSource != NULL
&& mCachedSource->getSize(&size) == OK) {
*bitrate = size * 8000000ll / mDurationUs; // in bits/sec
return true;