Skip to content

Commit

Permalink
Merge pull request #177 from Tencent/bugfix/android_default_fps
Browse files Browse the repository at this point in the history
bug: 解决播放不同fps素材导致fps错误问题 close #176
  • Loading branch information
hexleo authored Nov 29, 2021
2 parents 605b3a5 + 152fc4c commit 76b0dab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class AnimConfigManager(val player: AnimPlayer) {
this.defaultVideoMode = defaultVideoMode
fps = defaultFps
}
player.fps = config.fps
return true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class AnimPlayer(val animView: IAnimView) {
decoder?.fps = value
field = value
}
// 设置默认的fps <= 0 表示以vapc配置为准 > 0 表示以此设置为准
var defaultFps: Int = 0
var playLoop: Int = 0
set(value) {
decoder?.playLoop = value
Expand Down Expand Up @@ -84,7 +86,7 @@ class AnimPlayer(val animView: IAnimView) {
}
// 在线程中解析配置
decoder?.renderThread?.handler?.post {
val result = configManager.parseConfig(fileContainer, enableVersion1, videoMode, fps)
val result = configManager.parseConfig(fileContainer, enableVersion1, videoMode, defaultFps)
if (result != Constant.OK) {
isStartRunning = false
decoder?.onFailed(result, Constant.getErrorMsg(result))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ open class AnimView @JvmOverloads constructor(context: Context, attrs: Attribute
}

override fun setFps(fps: Int) {
player.fps = fps
ALog.i(TAG, "setFps=$fps")
player.defaultFps = fps
}

override fun setScaleType(type : ScaleType) {
Expand Down

0 comments on commit 76b0dab

Please sign in to comment.