am 57c332bd: am c024de3c: media: ignore null InputStream

* commit '57c332bd4ad9a2120e5ca93ae5ce9175913aeedd':
  media: ignore null InputStream
This commit is contained in:
Ronghua Wu
2015-10-13 15:46:00 +00:00
committed by Android Git Automerger

View File

@@ -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