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

Commit c42a96db authored by Robert Shih's avatar Robert Shih
Browse files

MediaPlayer: scanInternalSubtitleTracks in synchronous prepare

Bug: 16385674
Change-Id: I56d205ad2fe33bd64ea2251440c88fd4ecfa13ad
parent e647099e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1108,7 +1108,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},