Repository: flutter
Issue: [video_player] run video player for longer period will be cause app crash.
Labels: c: crash,platform-android,a: video,p: video_player,package,a: release,P2,c: fatal crash,team-android,triaged-android


## Steps to Reproduce

video_player version : 1.0.0

1. i watched a video about 40 minutes,and video's duration about 3 min.
2. when i switch to next video (in a vertical listview), and just few minute app crashed.

**Expected results:** <!-- what did you want to see? -->
don not crash :)

**Actual results:** <!-- what did you see? -->

app crash

<details> 
<summary>logs</summary> 

```
F/libc    (20448): Fatal signal 11 (SIGSEGV), code 0 (SI_USER) in tid 23285 (FinalizerDaemon), pid 20448 (banjia.rikiuser)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/beyond1qltezc/beyond1q:11/RP1A.200720.012/G9730ZCU5FUC2:user/release-keys'
Revision: '17'
ABI: 'arm64'
Timestamp: 2021-04-14 13:24:35+0800
pid: 20448, tid: 23285, name: FinalizerDaemon  >>> com.xxx.video_demo <<<
uid: 10337
signal 11 (SIGSEGV), code 0 (SI_USER), fault addr --------
    x0  0000000000000000  x1  00000073ca717dc7  x2  000000000000001a  x3  0000000000000030
    x4  00000073ca717de1  x5  000000742ad0525a  x6  6973736572707075  x7  6520646c6f20676e
    x8  00000073b286a288  x9  d1109266347eeae4  x10 000000742ad05240  x11 0000000000000010
    x12 63786520646c6f20  x13 203a6e6f69747065  x14 0000000000000008  x15 00000076bc8c7030
    x16 00000073cacb55b0  x17 00000076bc9e63dc  x18 00000073641ba000  x19 00000073b286a288
    x20 0000000000000000  x21 00000073b286bfb8  x22 00000073b286c000  x23 00000073b286a288
    x24 00000073b286c000  x25 000000000000000b  x26 00000073ca6e5391  x27 0000000000000000
    x28 00000073b286c000  x29 00000073b286a180
    lr  00000073caac3fc8  sp  00000073b286a0f0  pc  00000073caac0c14  pst 0000000060000000
backtrace:
      #00 pc 000000000046cc14  /apex/com.android.art/lib64/libart.so (art::mirror::Object::PrettyTypeOf()+36) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #01 pc 000000000046ffc4  /apex/com.android.art/lib64/libart.so (art::mirror::Throwable::Dump()+64) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #02 pc 00000000005968e8  /apex/com.android.art/lib64/libart.so (art::ScopedExceptionStorage::SuppressOldException(char const*)+360) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #03 pc 000000000037c8bc  /apex/com.android.art/lib64/libart.so (unsigned long art::jni::JniIdManager::EncodeGenericId<art::ArtMethod>(art::ReflectiveHandle<art::ArtMethod>)+848) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #04 pc 000000000037c290  /apex/com.android.art/lib64/libart.so (art::jni::JniIdManager::EncodeMethodId(art::ArtMethod*)+144) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #05 pc 00000000003f2b78  /apex/com.android.art/lib64/libart.so (art::JNI<true>::GetMethodID(_JNIEnv*, _jclass*, char const*, char const*)+680) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #06 pc 0000000000365cbc  /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::CheckJNI::GetMethodIDInternal(char const*, _JNIEnv*, _jclass*, char const*, char const*, bool)+748) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #07 pc 0000000000003704  /apex/com.android.art/lib64/libnativehelper.so (jniLogException+204) (BuildId: b3b6bb387064ddfce082886858b55667)
      #08 pc 00000000000820e0  /apex/com.android.art/javalib/arm64/boot.oat (art_jni_trampoline+208) (BuildId: 6f9ff290bb1f57d3f6d08d1d26898736989e8371)
      #09 pc 00000000001347e8  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #10 pc 0000000000198eb0  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+232) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #11 pc 000000000030c218  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #12 pc 0000000000307330  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+884) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #13 pc 000000000063ddc0  /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+548) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #14 pc 000000000012e994  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #15 pc 00000000000e9058  /apex/com.android.art/javalib/core-oj.jar (java.lang.System.logE+4)
      #16 pc 00000000002fed0c  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.2255279045661746555)+268) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #17 pc 00000000006299e8  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+796) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #18 pc 000000000013dff8  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #19 pc 000000000212dc50  /memfd:jit-cache (deleted) (offset 0x2000000) (java.lang.Daemons$FinalizerDaemon.doFinalize+160)
      #20 pc 0000000002126690  /memfd:jit-cache (deleted) (offset 0x2000000) (java.lang.Daemons$FinalizerDaemon.runInternal+544)
      #21 pc 000000000013487c  /apex/com.android.art/lib64/libart.so (art_quick_osr_stub+60) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #22 pc 000000000032a5a0  /apex/com.android.art/lib64/libart.so (art::jit::Jit::MaybeDoOnStackReplacement(art::Thread*, art::ArtMethod*, unsigned int, int, art::JValue*)+336) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #23 pc 00000000006466f8  /apex/com.android.art/lib64/libart.so (MterpMaybeDoOnStackReplacement+208) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #24 pc 0000000000133350  /apex/com.android.art/lib64/libart.so (MterpHelpers+240) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #25 pc 000000000002d1e6  /apex/com.android.art/javalib/core-libart.jar (java.lang.Daemons$FinalizerDaemon.runInternal+178)
      #26 pc 000000000063b274  /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+1440) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #27 pc 000000000012e814  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #28 pc 000000000002cede  /apex/com.android.art/javalib/core-libart.jar (java.lang.Daemons$Daemon.run+50)
      #29 pc 000000000063cc08  /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1840) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #30 pc 000000000012ea14  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #31 pc 00000000000eb8c8  /apex/com.android.art/javalib/core-oj.jar (java.lang.Thread.run+8)
      #32 pc 00000000002fed0c  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.2255279045661746555)+268) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #33 pc 00000000006299e8  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+796) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #34 pc 000000000013dff8  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #35 pc 0000000000134564  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #36 pc 0000000000198e94  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+204) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #37 pc 00000000005320fc  /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #38 pc 00000000005332fc  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+440) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #39 pc 000000000058081c  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1272) (BuildId: 7fc0d41a28a1404f2b602f6f7d92e844)
      #40 pc 00000000000b6234  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) (BuildId: fc6d84fe731b26a19216a676aee324da)
      #41 pc 0000000000050e64  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: fc6d84fe731b26a19216a676aee324da)
Lost connection to device.
```



```
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.22.6-0.0.pre.1, on Microsoft Windows [Version 10.0.19042.867], locale zh-CN)
|终止批处理操作吗(Y/N)? y

D:\flutterProjects\riki-user-flutter>flutter doctor -v
[√] Flutter (Channel stable, 1.22.6-0.0.pre.1, on Microsoft Windows [Version 10.0.19042.867], locale zh-CN)
    • Flutter version 1.22.6-0.0.pre.1 at D:\flutter\flutter
    • Framework revision 06aede56b0 (6 weeks ago), 2021-03-06 23:58:46 +0800
    • Engine revision ae90085a84
    • Dart version 2.10.4
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://mirrors.sjtug.sjtu.edu.cn/


[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\Admin\AppData\Local\Android\Sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = C:\Users\Admin\AppData\Local\Android\Sdk
    • Java binary at: D:\as4.1\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[!] Android Studio (version 4.1.0)
    • Android Studio at D:\as4.1
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[!] VS Code (version 1.55.2)
    • VS Code at C:\Users\Admin\AppData\Local\Programs\Microsoft VS Code
    X Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (1 available)
    • SM G9730 (mobile) • R28M31HPWXK • android-arm64 • Android 11 (API 30)

! Doctor found issues in 2 categories.

```

</details>