Android 9.0 ijkplayer setSpeed fail

421 views Asked by At

When I try to change video speed on Android 9.0, it dosen't work. Only fo 9.0 and only when set speed over 1.0. I just use mIjkVideoPlayer.setSpeed(1.0). It works on all other devices under 9.0. ijkplayer verson: 0.8.8 and this is the error log:

11-29 15:55:14.241 6747-6801/com.xiao.nicevieoplayer E/J4A: J4AC_android_media_AudioTrack__setSpeed 1.100000 11-29 15:55:14.241 6747-6801/com.xiao.nicevieoplayer D/AudioTrack: isSampleRateSpeedAllowed_l denied mAfLatency:80 mAfFrameCount:1920 mAfSampleRate:48000 sampleRate:44100 speed:1.100000 mFrameCount:3544 < minFrameCount:3888 11-29 15:55:14.241 6747-6801/com.xiao.nicevieoplayer W/AudioTrack: setPlaybackRate(1.100000, 1.000000) failed (buffer size) 11-29 15:55:14.242 6747-6801/com.xiao.nicevieoplayer W/System.err: java.lang.IllegalArgumentException: arguments out of range 11-29 15:55:14.242 6747-6801/com.xiao.nicevieoplayer W/System.err: at android.media.AudioTrack.native_set_playback_params(Native Method) 11-29 15:55:14.242 6747-6801/com.xiao.nicevieoplayer W/System.err: at android.media.AudioTrack.setPlaybackParams(AudioTrack.java:1902) 11-29 15:55:14.242 6747-6801/com.xiao.nicevieoplayer W/System.err: java.lang.IllegalArgumentException: arguments out of range 11-29 15:55:14.242 6747-6801/com.xiao.nicevieoplayer W/System.err: at android.media.AudioTrack.native_set_playback_params(Native Method) 11-29 15:55:14.242 6747-6801/com.xiao.nicevieoplayer W/System.err: at android.media.AudioTrack.setPlaybackParams(AudioTrack.java:1902)

1

There are 1 answers

0
king meng On

add this line when init ijkMediaPlayer:

ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "soundtouch", 1);