summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonghua Wu <ronghuawu@google.com>2015-10-13 15:40:48 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-10-13 15:40:48 +0000
commit57c332bd4ad9a2120e5ca93ae5ce9175913aeedd (patch)
treed62c8292018bf8352362b6932e342595a00967ae
parenta14d1bd798ca38f24b2f489ad7f32dff700b141e (diff)
parentc024de3c946c18e8e4799eb8d372fdec3146f8cf (diff)
downloadframeworks_base-57c332bd4ad9a2120e5ca93ae5ce9175913aeedd.zip
frameworks_base-57c332bd4ad9a2120e5ca93ae5ce9175913aeedd.tar.gz
frameworks_base-57c332bd4ad9a2120e5ca93ae5ce9175913aeedd.tar.bz2
am c024de3c: media: ignore null InputStream
* commit 'c024de3c946c18e8e4799eb8d372fdec3146f8cf': media: ignore null InputStream
-rw-r--r--media/java/android/media/MediaPlayer.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java
index 13b2878..2e82e2f 100644
--- a/media/java/android/media/MediaPlayer.java
+++ b/media/java/android/media/MediaPlayer.java
@@ -2243,10 +2243,14 @@ public class MediaPlayer implements SubtitleController.Listener
final InputStream fIs = is;
final MediaFormat fFormat = format;
- // Ensure all input streams are closed. It is also a handy
- // way to implement timeouts in the future.
- synchronized(mOpenSubtitleSources) {
- mOpenSubtitleSources.add(is);
+ if (is != null) {
+ // Ensure all input streams are closed. It is also a handy
+ // way to implement timeouts in the future.
+ synchronized(mOpenSubtitleSources) {
+ mOpenSubtitleSources.add(is);
+ }
+ } else {
+ Log.w(TAG, "addSubtitleSource called with null InputStream");
}
// process each subtitle in its own thread