Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c024de3c authored by Ronghua Wu's avatar Ronghua Wu
Browse files

media: ignore null InputStream

Bug: 22854896
Change-Id: I20b9e28bbba6dec73538ee6937d337c2e2b971f4
parent c1c462cb
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -2243,11 +2243,15 @@ public class MediaPlayer implements SubtitleController.Listener
        final InputStream fIs = is;
        final MediaFormat fFormat = format;

        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
        final HandlerThread thread = new HandlerThread("SubtitleReadThread",