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

Commit 05ad96e9 authored by Robert Shih's avatar Robert Shih Committed by Android (Google) Code Review
Browse files

Merge "MediaPlayer: scanInternalSubtitleTracks in synchronous prepare" into lmp-dev

parents c91e8285 c42a96db
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1118,7 +1118,12 @@ public class MediaPlayer implements SubtitleController.Listener
     *
     * @throws IllegalStateException if it is called in an invalid state
     */
    public native void prepare() throws IOException, IllegalStateException;
    public void prepare() throws IOException, IllegalStateException {
        _prepare();
        scanInternalSubtitleTracks();
    }

    private native void _prepare() throws IOException, IllegalStateException;

    /**
     * Prepares the player for playback, asynchronously.
+1 −1
Original line number Diff line number Diff line
@@ -861,7 +861,7 @@ static JNINativeMethod gMethods[] = {

    {"_setDataSource",       "(Ljava/io/FileDescriptor;JJ)V",    (void *)android_media_MediaPlayer_setDataSourceFD},
    {"_setVideoSurface",    "(Landroid/view/Surface;)V",        (void *)android_media_MediaPlayer_setVideoSurface},
    {"prepare",             "()V",                              (void *)android_media_MediaPlayer_prepare},
    {"_prepare",            "()V",                              (void *)android_media_MediaPlayer_prepare},
    {"prepareAsync",        "()V",                              (void *)android_media_MediaPlayer_prepareAsync},
    {"_start",              "()V",                              (void *)android_media_MediaPlayer_start},
    {"_stop",               "()V",                              (void *)android_media_MediaPlayer_stop},