HW not started on first run after VideoView initialization (Android)
Summary
After VideoView initialization, HW in 100% times not started on the first playback run. If playback stopped and started again, HW runs well.
If the Android app was backgrounded (paused) and resumed, and VideoView re-inited, HW will not work again on the first playback start.
Minimal project and steps to reproduce
Try video playback with HW in any app using LibVLCSharp on Android.
What is the current bug behavior?
Video is playing without HW on the first run. If the device is too weak, the video is stuttering.
What is the expected correct behavior?
HW should start from the first run of video playback.
Does it work on other plaforms? Does it work with the official VLC apps?
VLC for Android starts HW on the first run on video playback.
Relevant logs and/or screenshots
https://pastebin.com/raw/4M7zT0GA
This log tracks two playbacks of HD stream. For the first stop of playback, we can see that there is only the line MediaCodec via NDK closed but for second playback there are lines MediaCodec via NDK opened and MediaCodec via NDK closed
This also happens for SD streams, but as they are not too CPU greedy, stream plays smoothly without HW.
Log for SD stream https://pastebin.com/raw/9RFTQFmr
Environment
- OS: Android
- Version All
- Device: All
- LibVLC version and architecture: 3.2.7 (armeabi-v7a, arm64-v8a)
- LibVLCSharp version: 3.4.3
Updated: Logs added