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

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

View File

@@ -2243,11 +2243,15 @@ public class MediaPlayer implements SubtitleController.Listener
final InputStream fIs = is; final InputStream fIs = is;
final MediaFormat fFormat = format; final MediaFormat fFormat = format;
if (is != null) {
// Ensure all input streams are closed. It is also a handy // Ensure all input streams are closed. It is also a handy
// way to implement timeouts in the future. // way to implement timeouts in the future.
synchronized(mOpenSubtitleSources) { synchronized(mOpenSubtitleSources) {
mOpenSubtitleSources.add(is); mOpenSubtitleSources.add(is);
} }
} else {
Log.w(TAG, "addSubtitleSource called with null InputStream");
}
// process each subtitle in its own thread // process each subtitle in its own thread
final HandlerThread thread = new HandlerThread("SubtitleReadThread", final HandlerThread thread = new HandlerThread("SubtitleReadThread",