Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnimPlayer.isStartRunning赋值问题,导致无法播放 #180

Closed
zijinzhiyun opened this issue Dec 6, 2021 · 19 comments
Closed

AnimPlayer.isStartRunning赋值问题,导致无法播放 #180

zijinzhiyun opened this issue Dec 6, 2021 · 19 comments

Comments

@zijinzhiyun
Copy link

zijinzhiyun commented Dec 6, 2021

发现播放时AnimPlayer.isStartRunning一直为true,导致视频一直无法播放。以下代码不知道是不是引发问题的原因
AnimPlayer.startPlay会调用decoder?.prepareThread(),prepareThread()会调用createThread(),createThread()中只try了OutOfMemoryError,这时发生了其它异常,无法没办法try住,无法走到decoder?.prepareThread() == false中的isStartRunning = false逻辑,导致isStartRunning一直为true,之后就会一直无法播放了

@hexleo
Copy link
Collaborator

hexleo commented Dec 7, 2021

你说的这个问题是有必现路径吗?如果没有catch住的话,应该会crash才对,能提供日志吗?

@zijinzhiyun
Copy link
Author

线上复现的,没有日志,尝试复现,没有找到必现路径。不会崩溃的,animView中调用player.startPlay()会try catch的

override fun startPlay(fileContainer: IFileContainer) {
ui {
if (visibility != View.VISIBLE) {
ALog.e(TAG, "AnimView is GONE, can't play")
return@ui
}
if (!player.isRunning()) {
lastFile = fileContainer
player.startPlay(fileContainer)
} else {
ALog.e(TAG, "is running can not start")
}
}

@hexleo
Copy link
Collaborator

hexleo commented Dec 7, 2021

最外层是有try catch,我看看这个问题

@zijinzhiyun
Copy link
Author

zijinzhiyun commented Dec 7, 2021

2021-12-07 15:12:07.671 21740-21740/: FileContainer init
2021-12-07 15:12:07.672 21740-23717/: onVideoDestroy
2021-12-07 15:12:07.672 21740-23717/: onVideoDestroy:
2021-12-07 15:12:07.673 21740-23717/: parseConfig cost=2ms enableVersion1=false result=true
2021-12-07 15:12:07.673 21740-23717/: onConfigCreate
2021-12-07 15:12:07.673 21740-23717/: parse AnimConfig(version=2, totalFrames=61, width=640, height=1139, videoWidth=976, videoHeight=1152, orien=0, fps=9, isMix=false, alphaPointRect=PointRect(x=644, y=0, w=320, h=569), rgbPointRect=PointRect(x=0, y=0, w=640, h=1139), isDefaultConfig=false)
2021-12-07 15:12:07.673 21740-23717/: innerStartPlay
2021-12-07 15:12:07.673 21740-23717/: prepareTextureView
2021-12-07 15:12:07.682 21740-21740/: prepareTextureViewRunnable
2021-12-07 15:12:07.682 21740-21740/: scaleType=CENTER_CROP
2021-12-07 15:12:07.697 21740-21740/: onSurfaceTextureAvailable width=1260 height=2244
2021-12-07 15:12:07.697 21740-21740/: AnimPlayer onSurfaceTextureAvailable
2021-12-07 15:12:07.697 21740-21740/: innerStartPlay
2021-12-07 15:12:07.697 21740-21740/: HardDecoder start
2021-12-07 15:12:07.697 21740-21740/: AudioPlayer start
2021-12-07 15:12:07.698 21740-26059/: AudioPlayer startPlay
2021-12-07 15:12:07.698 21740-23717/: HardDecoder startPlay
2021-12-07 15:12:07.744 21740-26059/: Extractor selected track 1 (audio/mp4a-latm): {max-bitrate=128000, sample-rate=48000, track-id=2, mime=audio/mp4a-latm, profile=2, bitrate=103865, language=und, aac-profile=2, encoder-delay=1024, durationUs=7149333, channel-count=2, encoder-padding=0, max-input-size=579, csd-0=java.nio.HeapByteBuffer[pos=0 lim=5 cap=5]}
2021-12-07 15:12:07.745 21740-23717/: Extractor selected track 0 (video/avc): {max-bitrate=1956038, track-id=1, level=2048, mime=video/avc, frame-count=61, profile=2, bitrate=1956038, language=und, display-width=976, csd-1=java.nio.HeapByteBuffer[pos=0 lim=8 cap=8], durationUs=6777777, display-height=1152, width=976, max-input-size=56621, frame-rate=9, height=1152, csd-0=java.nio.HeapByteBuffer[pos=0 lim=28 cap=28]}
2021-12-07 15:12:07.750 21740-23717/: Video size is 976 x 1152
2021-12-07 15:12:07.750 21740-23717/: prepareRender
2021-12-07 15:12:07.754 21740-26059/: audio mime=audio/mp4a-latm
2021-12-07 15:12:07.756 21740-23717/: onRenderCreate
2021-12-07 15:12:07.756 21740-23717/: mask render init
2021-12-07 15:12:07.759 21740-23717/: Video MIME is video/avc
2021-12-07 15:12:07.877 21740-24903/: submitted frame 0 to dec, size=32234
2021-12-07 15:12:07.887 21740-24903/: no output from decoder available
2021-12-07 15:12:07.889 21740-24903/: submitted frame 1 to dec, size=152
2021-12-07 15:12:07.899 21740-24903/: no output from decoder available
2021-12-07 15:12:07.900 21740-24903/: submitted frame 2 to dec, size=26501
2021-12-07 15:12:07.910 21740-24903/: no output from decoder available
2021-12-07 15:12:07.911 21740-24903/: submitted frame 3 to dec, size=26171
2021-12-07 15:12:07.924 21740-24903/: no output from decoder available
2021-12-07 15:12:07.925 21740-24903/: submitted frame 4 to dec, size=31579
2021-12-07 15:12:07.926 21740-24903/: decoder output buffers changed
2021-12-07 15:12:07.935 21740-24903/: submitted frame 5 to dec, size=35572
2021-12-07 15:12:07.937 21740-24903/: decoder output format changed: {crop-right=975, color-format=2141391878, slice-height=1152, mime=video/raw, hdr-static-info=java.nio.HeapByteBuffer[pos=0 lim=25 cap=25], stride=1024, color-standard=1, color-transfer=3, crop-bottom=1151, crop-left=0, width=976, color-range=2, crop-top=0, height=1152}
2021-12-07 15:12:07.948 21740-24903/: submitted frame 6 to dec, size=33244
2021-12-07 15:12:07.952 21740-24903/: onVideoStart
2021-12-07 15:12:07.954 21740-23717/: onFrameAvailable
2021-12-07 15:12:07.955 21740-24903/: onVideoStart:
2021-12-07 15:12:07.956 21740-24903/: onDecoding decodeIndex=0
2021-12-07 15:12:07.956 21740-24903/: onVideoRender
2021-12-07 15:12:07.956 21740-24903/: decode frameIndex=1
2021-12-07 15:12:07.957 21740-24903/: submitted frame 7 to dec, size=34450
2021-12-07 15:12:07.961 21740-23717/: onRendering frameIndex=0
2021-12-07 15:12:08.066 21740-24903/: onDecoding decodeIndex=1
2021-12-07 15:12:08.066 21740-24903/: onVideoRender
2021-12-07 15:12:08.066 21740-24903/: decode frameIndex=2
2021-12-07 15:12:08.066 21740-24903/: submitted frame 8 to dec, size=31916
2021-12-07 15:12:08.067 21740-23717/: onFrameAvailable
2021-12-07 15:12:08.068 21740-23717/: onRendering frameIndex=1
2021-12-07 15:12:08.175 21740-24903/: onDecoding decodeIndex=2
2021-12-07 15:12:08.175 21740-24903/: onVideoRender
2021-12-07 15:12:08.175 21740-24903/: decode frameIndex=3
2021-12-07 15:12:08.176 21740-24903/: submitted frame 9 to dec, size=28834
2021-12-07 15:12:08.176 21740-23717/: onFrameAvailable
2021-12-07 15:12:08.180 21740-23717/: onRendering frameIndex=2
2021-12-07 15:12:08.286 21740-24903/: onDecoding decodeIndex=3
2021-12-07 15:12:08.286 21740-24903/: onVideoRender
2021-12-07 15:12:08.286 21740-24903/: decode frameIndex=4
2021-12-07 15:12:08.287 21740-24903/: submitted frame 10 to dec, size=29599
2021-12-07 15:12:08.287 21740-23717/: onFrameAvailable
2021-12-07 15:12:08.291 21740-23717/: onRendering frameIndex=3
2021-12-07 15:12:08.397 21740-24903/: onDecoding decodeIndex=4
2021-12-07 15:12:08.397 21740-24903/: onVideoRender
2021-12-07 15:12:08.397 21740-24903/: decode frameIndex=5
2021-12-07 15:12:08.399 21740-23717/: onFrameAvailable
2021-12-07 15:12:08.399 21740-24903/: submitted frame 11 to dec, size=28613
2021-12-07 15:12:08.400 21740-23717/: onRendering frameIndex=4
2021-12-07 15:12:08.511 21740-23717/: onFrameAvailable
2021-12-07 15:12:08.513 21740-23717/: onRendering frameIndex=5
2021-12-07 15:12:08.513 21740-24903/: onDecoding decodeIndex=5
2021-12-07 15:12:08.513 21740-24903/: onVideoRender
2021-12-07 15:12:08.513 21740-24903/: decode frameIndex=6
2021-12-07 15:12:08.515 21740-24903/: submitted frame 12 to dec, size=26040
2021-12-07 15:12:08.619 21740-24903/: onDecoding decodeIndex=6
2021-12-07 15:12:08.619 21740-24903/: onVideoRender
2021-12-07 15:12:08.619 21740-24903/: decode frameIndex=7
2021-12-07 15:12:08.621 21740-23717/: onFrameAvailable
2021-12-07 15:12:08.621 21740-24903/: submitted frame 13 to dec, size=23089
2021-12-07 15:12:08.623 21740-23717/: onRendering frameIndex=6
2021-12-07 15:12:08.731 21740-24903/: onDecoding decodeIndex=7
2021-12-07 15:12:08.731 21740-24903/: onVideoRender
2021-12-07 15:12:08.731 21740-24903/: decode frameIndex=8
2021-12-07 15:12:08.732 21740-24903/: submitted frame 14 to dec, size=44366
2021-12-07 15:12:08.733 21740-23717/: onFrameAvailable
2021-12-07 15:12:08.734 21740-23717/: onRendering frameIndex=7
2021-12-07 15:12:08.843 21740-24903/: onDecoding decodeIndex=8
2021-12-07 15:12:08.843 21740-24903/: onVideoRender
2021-12-07 15:12:08.843 21740-24903/: decode frameIndex=9
2021-12-07 15:12:08.845 21740-23717/: onFrameAvailable
2021-12-07 15:12:08.847 21740-23717/: onRendering frameIndex=8
2021-12-07 15:12:08.848 21740-24903/: submitted frame 15 to dec, size=28488
2021-12-07 15:12:08.957 21740-24903/: onDecoding decodeIndex=9
2021-12-07 15:12:08.957 21740-24903/: onVideoRender
2021-12-07 15:12:08.957 21740-24903/: decode frameIndex=10
2021-12-07 15:12:08.960 21740-23717/: onFrameAvailable
2021-12-07 15:12:08.962 21740-24903/: submitted frame 16 to dec, size=25757
2021-12-07 15:12:08.964 21740-23717/: onRendering frameIndex=9
2021-12-07 15:12:09.067 21740-24903/: onDecoding decodeIndex=10
2021-12-07 15:12:09.067 21740-24903/: onVideoRender
2021-12-07 15:12:09.067 21740-24903/: decode frameIndex=11
2021-12-07 15:12:09.068 21740-23717/: onFrameAvailable
2021-12-07 15:12:09.069 21740-24903/: submitted frame 17 to dec, size=1407
2021-12-07 15:12:09.070 21740-23717/: onRendering frameIndex=10
2021-12-07 15:12:09.175 21740-24903/: onDecoding decodeIndex=11
2021-12-07 15:12:09.176 21740-24903/: onVideoRender
2021-12-07 15:12:09.176 21740-24903/: decode frameIndex=12
2021-12-07 15:12:09.178 21740-23717/: onFrameAvailable
2021-12-07 15:12:09.179 21740-24903/: submitted frame 18 to dec, size=35059
2021-12-07 15:12:09.180 21740-23717/: onRendering frameIndex=11
2021-12-07 15:12:09.288 21740-23717/: onFrameAvailable
2021-12-07 15:12:09.290 21740-23717/: onRendering frameIndex=12
2021-12-07 15:12:09.292 21740-24903/: onDecoding decodeIndex=12
2021-12-07 15:12:09.292 21740-24903/: onVideoRender
2021-12-07 15:12:09.292 21740-24903/: decode frameIndex=13
2021-12-07 15:12:09.297 21740-24903/: submitted frame 19 to dec, size=27408
2021-12-07 15:12:09.397 21740-24903/: onDecoding decodeIndex=13
2021-12-07 15:12:09.397 21740-24903/: onVideoRender
2021-12-07 15:12:09.397 21740-24903/: decode frameIndex=14
2021-12-07 15:12:09.397 21740-24903/: submitted frame 20 to dec, size=28118
2021-12-07 15:12:09.398 21740-23717/: onFrameAvailable
2021-12-07 15:12:09.399 21740-23717/: onRendering frameIndex=13
2021-12-07 15:12:09.510 21740-24903/: onDecoding decodeIndex=14
2021-12-07 15:12:09.510 21740-23717/: onFrameAvailable
2021-12-07 15:12:09.510 21740-24903/: onVideoRender
2021-12-07 15:12:09.510 21740-24903/: decode frameIndex=15
2021-12-07 15:12:09.512 21740-24903/: submitted frame 21 to dec, size=40256
2021-12-07 15:12:09.515 21740-23717/: onRendering frameIndex=14
2021-12-07 15:12:09.621 21740-23717/: onFrameAvailable
2021-12-07 15:12:09.624 21740-23717/: onRendering frameIndex=15
2021-12-07 15:12:09.627 21740-24903/: onDecoding decodeIndex=15
2021-12-07 15:12:09.628 21740-24903/: onVideoRender
2021-12-07 15:12:09.628 21740-24903/: decode frameIndex=16
2021-12-07 15:12:09.629 21740-24903/: submitted frame 22 to dec, size=24590
2021-12-07 15:12:09.732 21740-24903/: onDecoding decodeIndex=16
2021-12-07 15:12:09.732 21740-24903/: onVideoRender
2021-12-07 15:12:09.732 21740-24903/: decode frameIndex=17
2021-12-07 15:12:09.734 21740-24903/: submitted frame 23 to dec, size=26204
2021-12-07 15:12:09.734 21740-23717/: onFrameAvailable
2021-12-07 15:12:09.735 21740-23717/: onRendering frameIndex=16
2021-12-07 15:12:09.842 21740-24903/: onDecoding decodeIndex=17
2021-12-07 15:12:09.842 21740-24903/: onVideoRender
2021-12-07 15:12:09.842 21740-24903/: decode frameIndex=18
2021-12-07 15:12:09.842 21740-24903/: submitted frame 24 to dec, size=25918
2021-12-07 15:12:09.844 21740-23717/: onFrameAvailable
2021-12-07 15:12:09.846 21740-23717/: onRendering frameIndex=17
2021-12-07 15:12:09.954 21740-24903/: onDecoding decodeIndex=18
2021-12-07 15:12:09.954 21740-24903/: onVideoRender
2021-12-07 15:12:09.954 21740-24903/: decode frameIndex=19
2021-12-07 15:12:09.955 21740-24903/: submitted frame 25 to dec, size=28342
2021-12-07 15:12:09.957 21740-23717/: onFrameAvailable
2021-12-07 15:12:09.959 21740-23717/: onRendering frameIndex=18
2021-12-07 15:12:10.064 21740-24903/: onDecoding decodeIndex=19
2021-12-07 15:12:10.064 21740-24903/: onVideoRender
2021-12-07 15:12:10.064 21740-24903/: decode frameIndex=20
2021-12-07 15:12:10.065 21740-24903/: submitted frame 26 to dec, size=32970
2021-12-07 15:12:10.065 21740-23717/: onFrameAvailable
2021-12-07 15:12:10.069 21740-23717/: onRendering frameIndex=19
2021-12-07 15:12:10.176 21740-23717/: onFrameAvailable
2021-12-07 15:12:10.176 21740-24903/: onDecoding decodeIndex=20
2021-12-07 15:12:10.176 21740-24903/: onVideoRender
2021-12-07 15:12:10.176 21740-24903/: decode frameIndex=21
2021-12-07 15:12:10.178 21740-24903/: submitted frame 27 to dec, size=1665
2021-12-07 15:12:10.178 21740-23717/: onRendering frameIndex=20
2021-12-07 15:12:10.287 21740-23717/: onFrameAvailable
2021-12-07 15:12:10.287 21740-24903/: onDecoding decodeIndex=21
2021-12-07 15:12:10.287 21740-24903/: onVideoRender
2021-12-07 15:12:10.287 21740-24903/: decode frameIndex=22
2021-12-07 15:12:10.289 21740-24903/: submitted frame 28 to dec, size=36031
2021-12-07 15:12:10.289 21740-23717/: onRendering frameIndex=21
2021-12-07 15:12:10.397 21740-24903/: onDecoding decodeIndex=22
2021-12-07 15:12:10.397 21740-24903/: onVideoRender
2021-12-07 15:12:10.397 21740-24903/: decode frameIndex=23
2021-12-07 15:12:10.398 21740-23717/: onFrameAvailable
2021-12-07 15:12:10.398 21740-24903/: submitted frame 29 to dec, size=25520
2021-12-07 15:12:10.399 21740-23717/: onRendering frameIndex=22
2021-12-07 15:12:10.508 21740-24903/: onDecoding decodeIndex=23
2021-12-07 15:12:10.508 21740-24903/: onVideoRender
2021-12-07 15:12:10.509 21740-24903/: decode frameIndex=24
2021-12-07 15:12:10.509 21740-23717/: onFrameAvailable
2021-12-07 15:12:10.511 21740-23717/: onRendering frameIndex=23
2021-12-07 15:12:10.514 21740-24903/: submitted frame 30 to dec, size=27948
2021-12-07 15:12:10.622 21740-24903/: onDecoding decodeIndex=24
2021-12-07 15:12:10.622 21740-24903/: onVideoRender
2021-12-07 15:12:10.622 21740-24903/: decode frameIndex=25
2021-12-07 15:12:10.623 21740-23717/: onFrameAvailable
2021-12-07 15:12:10.626 21740-23717/: onRendering frameIndex=24
2021-12-07 15:12:10.631 21740-24903/: submitted frame 31 to dec, size=48883
2021-12-07 15:12:10.732 21740-23717/: onFrameAvailable
2021-12-07 15:12:10.733 21740-23717/: onRendering frameIndex=25
2021-12-07 15:12:10.735 21740-24903/: onDecoding decodeIndex=25
2021-12-07 15:12:10.735 21740-24903/: onVideoRender
2021-12-07 15:12:10.735 21740-24903/: decode frameIndex=26
2021-12-07 15:12:10.736 21740-24903/: submitted frame 32 to dec, size=27691
2021-12-07 15:12:10.843 21740-23717/: onFrameAvailable
2021-12-07 15:12:10.844 21740-24903/: onDecoding decodeIndex=26
2021-12-07 15:12:10.844 21740-24903/: onVideoRender
2021-12-07 15:12:10.845 21740-24903/: decode frameIndex=27
2021-12-07 15:12:10.845 21740-24903/: submitted frame 33 to dec, size=9968
2021-12-07 15:12:10.846 21740-23717/: onRendering frameIndex=26
2021-12-07 15:12:10.953 21740-24903/: onDecoding decodeIndex=27
2021-12-07 15:12:10.953 21740-24903/: onVideoRender
2021-12-07 15:12:10.953 21740-24903/: decode frameIndex=28
2021-12-07 15:12:10.956 21740-24903/: submitted frame 34 to dec, size=14501
2021-12-07 15:12:10.956 21740-23717/: onFrameAvailable
2021-12-07 15:12:10.958 21740-23717/: onRendering frameIndex=27
2021-12-07 15:12:11.066 21740-24903/: onDecoding decodeIndex=28
2021-12-07 15:12:11.066 21740-24903/: onVideoRender
2021-12-07 15:12:11.066 21740-24903/: decode frameIndex=29
2021-12-07 15:12:11.069 21740-23717/: onFrameAvailable
2021-12-07 15:12:11.070 21740-23717/: onRendering frameIndex=28
2021-12-07 15:12:11.078 21740-24903/: submitted frame 35 to dec, size=40127
2021-12-07 15:12:11.180 21740-24903/: onDecoding decodeIndex=29
2021-12-07 15:12:11.180 21740-24903/: onVideoRender
2021-12-07 15:12:11.180 21740-24903/: decode frameIndex=30
2021-12-07 15:12:11.181 21740-23717/: onFrameAvailable
2021-12-07 15:12:11.181 21740-24903/: submitted frame 36 to dec, size=34160
2021-12-07 15:12:11.182 21740-23717/: onRendering frameIndex=29
2021-12-07 15:12:11.288 21740-24903/: onDecoding decodeIndex=30
2021-12-07 15:12:11.288 21740-24903/: onVideoRender
2021-12-07 15:12:11.288 21740-24903/: decode frameIndex=31
2021-12-07 15:12:11.289 21740-24903/: submitted frame 37 to dec, size=33611
2021-12-07 15:12:11.290 21740-23717/: onFrameAvailable
2021-12-07 15:12:11.291 21740-23717/: onRendering frameIndex=30
2021-12-07 15:12:11.398 21740-24903/: onDecoding decodeIndex=31
2021-12-07 15:12:11.398 21740-24903/: onVideoRender
2021-12-07 15:12:11.398 21740-24903/: decode frameIndex=32
2021-12-07 15:12:11.400 21740-23717/: onFrameAvailable
2021-12-07 15:12:11.401 21740-24903/: submitted frame 38 to dec, size=35346
2021-12-07 15:12:11.401 21740-23717/: onRendering frameIndex=31
2021-12-07 15:12:11.511 21740-24903/: onDecoding decodeIndex=32
2021-12-07 15:12:11.511 21740-24903/: onVideoRender
2021-12-07 15:12:11.512 21740-24903/: decode frameIndex=33
2021-12-07 15:12:11.513 21740-24903/: submitted frame 39 to dec, size=56601
2021-12-07 15:12:11.515 21740-23717/: onFrameAvailable
2021-12-07 15:12:11.517 21740-23717/: onRendering frameIndex=32
2021-12-07 15:12:11.623 21740-24903/: onDecoding decodeIndex=33
2021-12-07 15:12:11.624 21740-24903/: onVideoRender
2021-12-07 15:12:11.624 21740-23717/: onFrameAvailable
2021-12-07 15:12:11.624 21740-24903/: decode frameIndex=34
2021-12-07 15:12:11.626 21740-23717/: onRendering frameIndex=33
2021-12-07 15:12:11.626 21740-24903/: submitted frame 40 to dec, size=47534
2021-12-07 15:12:11.730 21740-24903/: onDecoding decodeIndex=34
2021-12-07 15:12:11.730 21740-24903/: onVideoRender
2021-12-07 15:12:11.730 21740-24903/: decode frameIndex=35
2021-12-07 15:12:11.731 21740-23717/: onFrameAvailable
2021-12-07 15:12:11.733 21740-24903/: submitted frame 41 to dec, size=33532
2021-12-07 15:12:11.738 21740-23717/: onRendering frameIndex=34
2021-12-07 15:12:11.844 21740-24903/: onDecoding decodeIndex=35
2021-12-07 15:12:11.844 21740-24903/: onVideoRender
2021-12-07 15:12:11.844 21740-24903/: decode frameIndex=36
2021-12-07 15:12:11.845 21740-24903/: submitted frame 42 to dec, size=29754
2021-12-07 15:12:11.845 21740-23717/: onFrameAvailable
2021-12-07 15:12:11.847 21740-23717/: onRendering frameIndex=35
2021-12-07 15:12:11.955 21740-23717/: onFrameAvailable
2021-12-07 15:12:11.955 21740-24903/: onDecoding decodeIndex=36
2021-12-07 15:12:11.956 21740-23717/: onRendering frameIndex=36
2021-12-07 15:12:11.957 21740-24903/: onVideoRender
2021-12-07 15:12:11.957 21740-24903/: decode frameIndex=37
2021-12-07 15:12:11.959 21740-24903/: submitted frame 43 to dec, size=27944
2021-12-07 15:12:12.064 21740-24903/: onDecoding decodeIndex=37
2021-12-07 15:12:12.065 21740-24903/: onVideoRender
2021-12-07 15:12:12.066 21740-23717/: onFrameAvailable
2021-12-07 15:12:12.066 21740-24903/: decode frameIndex=38
2021-12-07 15:12:12.067 21740-24903/: submitted frame 44 to dec, size=27398
2021-12-07 15:12:12.068 21740-23717/: onRendering frameIndex=37
2021-12-07 15:12:12.176 21740-23717/: onFrameAvailable
2021-12-07 15:12:12.178 21740-23717/: onRendering frameIndex=38
2021-12-07 15:12:12.178 21740-24903/: onDecoding decodeIndex=38
2021-12-07 15:12:12.179 21740-24903/: onVideoRender
2021-12-07 15:12:12.188 21740-24903/: decode frameIndex=39
2021-12-07 15:12:12.192 21740-24903/: submitted frame 45 to dec, size=27830
2021-12-07 15:12:12.287 21740-24903/: onDecoding decodeIndex=39
2021-12-07 15:12:12.287 21740-24903/: onVideoRender
2021-12-07 15:12:12.287 21740-24903/: decode frameIndex=40
2021-12-07 15:12:12.288 21740-23717/: onFrameAvailable
2021-12-07 15:12:12.289 21740-24903/: submitted frame 46 to dec, size=27105
2021-12-07 15:12:12.290 21740-23717/: onRendering frameIndex=39
2021-12-07 15:12:12.397 21740-24903/: onDecoding decodeIndex=40
2021-12-07 15:12:12.397 21740-24903/: onVideoRender
2021-12-07 15:12:12.397 21740-24903/: decode frameIndex=41
2021-12-07 15:12:12.399 21740-23717/: onFrameAvailable
2021-12-07 15:12:12.400 21740-23717/: onRendering frameIndex=40
2021-12-07 15:12:12.402 21740-24903/: submitted frame 47 to dec, size=27663
2021-12-07 15:12:12.509 21740-24903/: onDecoding decodeIndex=41
2021-12-07 15:12:12.509 21740-24903/: onVideoRender
2021-12-07 15:12:12.509 21740-24903/: decode frameIndex=42
2021-12-07 15:12:12.510 21740-23717/: onFrameAvailable
2021-12-07 15:12:12.511 21740-24903/: submitted frame 48 to dec, size=28320
2021-12-07 15:12:12.511 21740-23717/: onRendering frameIndex=41
2021-12-07 15:12:12.621 21740-24903/: onDecoding decodeIndex=42
2021-12-07 15:12:12.621 21740-24903/: onVideoRender
2021-12-07 15:12:12.621 21740-24903/: decode frameIndex=43
2021-12-07 15:12:12.622 21740-23717/: onFrameAvailable
2021-12-07 15:12:12.624 21740-23717/: onRendering frameIndex=42
2021-12-07 15:12:12.630 21740-24903/: submitted frame 49 to dec, size=26076
2021-12-07 15:12:12.731 21740-24903/: onDecoding decodeIndex=43
2021-12-07 15:12:12.731 21740-24903/: onVideoRender
2021-12-07 15:12:12.731 21740-24903/: decode frameIndex=44
2021-12-07 15:12:12.732 21740-23717/: onFrameAvailable
2021-12-07 15:12:12.733 21740-23717/: onRendering frameIndex=43
2021-12-07 15:12:12.735 21740-24903/: submitted frame 50 to dec, size=26052
2021-12-07 15:12:12.846 21740-23717/: onFrameAvailable
2021-12-07 15:12:12.850 21740-23717/: onRendering frameIndex=44
2021-12-07 15:12:12.850 21740-24903/: onDecoding decodeIndex=44
2021-12-07 15:12:12.850 21740-24903/: onVideoRender
2021-12-07 15:12:12.850 21740-24903/: decode frameIndex=45
2021-12-07 15:12:12.852 21740-24903/: submitted frame 51 to dec, size=24622
2021-12-07 15:12:12.953 21740-23717/: onFrameAvailable
2021-12-07 15:12:12.954 21740-24903/: onDecoding decodeIndex=45
2021-12-07 15:12:12.954 21740-23717/: onRendering frameIndex=45
2021-12-07 15:12:12.954 21740-24903/: onVideoRender
2021-12-07 15:12:12.954 21740-24903/: decode frameIndex=46
2021-12-07 15:12:12.955 21740-24903/: submitted frame 52 to dec, size=24838
2021-12-07 15:12:13.066 21740-23717/: onFrameAvailable
2021-12-07 15:12:13.066 21740-24903/: onDecoding decodeIndex=46
2021-12-07 15:12:13.066 21740-24903/: onVideoRender
2021-12-07 15:12:13.066 21740-24903/: decode frameIndex=47
2021-12-07 15:12:13.067 21740-24903/: submitted frame 53 to dec, size=25502
2021-12-07 15:12:13.068 21740-23717/: onRendering frameIndex=46
2021-12-07 15:12:13.176 21740-24903/: onDecoding decodeIndex=47
2021-12-07 15:12:13.176 21740-24903/: onVideoRender
2021-12-07 15:12:13.176 21740-24903/: decode frameIndex=48
2021-12-07 15:12:13.178 21740-23717/: onFrameAvailable
2021-12-07 15:12:13.180 21740-24903/: submitted frame 54 to dec, size=23202
2021-12-07 15:12:13.180 21740-23717/: onRendering frameIndex=47
2021-12-07 15:12:13.287 21740-24903/: onDecoding decodeIndex=48
2021-12-07 15:12:13.287 21740-24903/: onVideoRender
2021-12-07 15:12:13.287 21740-24903/: decode frameIndex=49
2021-12-07 15:12:13.288 21740-24903/: submitted frame 55 to dec, size=21956
2021-12-07 15:12:13.288 21740-23717/: onFrameAvailable
2021-12-07 15:12:13.291 21740-23717/: onRendering frameIndex=48
2021-12-07 15:12:13.398 21740-24903/: onDecoding decodeIndex=49
2021-12-07 15:12:13.398 21740-24903/: onVideoRender
2021-12-07 15:12:13.399 21740-24903/: decode frameIndex=50
2021-12-07 15:12:13.399 21740-24903/: submitted frame 56 to dec, size=21066
2021-12-07 15:12:13.399 21740-23717/: onFrameAvailable
2021-12-07 15:12:13.400 21740-23717/: onRendering frameIndex=49
2021-12-07 15:12:13.510 21740-24903/: onDecoding decodeIndex=50
2021-12-07 15:12:13.510 21740-24903/: onVideoRender
2021-12-07 15:12:13.510 21740-24903/: decode frameIndex=51
2021-12-07 15:12:13.513 21740-23717/: onFrameAvailable
2021-12-07 15:12:13.516 21740-23717/: onRendering frameIndex=50
2021-12-07 15:12:13.519 21740-24903/: submitted frame 57 to dec, size=17618
2021-12-07 15:12:13.619 21740-24903/: onDecoding decodeIndex=51
2021-12-07 15:12:13.619 21740-24903/: onVideoRender
2021-12-07 15:12:13.619 21740-24903/: decode frameIndex=52
2021-12-07 15:12:13.621 21740-23717/: onFrameAvailable
2021-12-07 15:12:13.621 21740-24903/: submitted frame 58 to dec, size=12802
2021-12-07 15:12:13.622 21740-23717/: onRendering frameIndex=51
2021-12-07 15:12:13.731 21740-23717/: onFrameAvailable
2021-12-07 15:12:13.733 21740-24903/: onDecoding decodeIndex=52
2021-12-07 15:12:13.733 21740-24903/: onVideoRender
2021-12-07 15:12:13.733 21740-24903/: decode frameIndex=53
2021-12-07 15:12:13.734 21740-24903/: submitted frame 59 to dec, size=7397
2021-12-07 15:12:13.737 21740-23717/: onRendering frameIndex=52
2021-12-07 15:12:13.841 21740-24903/: onDecoding decodeIndex=53
2021-12-07 15:12:13.841 21740-24903/: onVideoRender
2021-12-07 15:12:13.841 21740-24903/: decode frameIndex=54
2021-12-07 15:12:13.843 21740-24903/: submitted frame 60 to dec, size=59
2021-12-07 15:12:13.844 21740-23717/: onFrameAvailable
2021-12-07 15:12:13.848 21740-23717/: onRendering frameIndex=53
2021-12-07 15:12:13.953 21740-24903/: onDecoding decodeIndex=54
2021-12-07 15:12:13.953 21740-24903/: onVideoRender
2021-12-07 15:12:13.953 21740-24903/: decode frameIndex=55
2021-12-07 15:12:13.954 21740-23717/: onFrameAvailable
2021-12-07 15:12:13.955 21740-23717/: onRendering frameIndex=54
2021-12-07 15:12:13.955 21740-24903/: decode EOS
2021-12-07 15:12:14.064 21740-24903/: onDecoding decodeIndex=55
2021-12-07 15:12:14.064 21740-24903/: onVideoRender
2021-12-07 15:12:14.064 21740-24903/: decode frameIndex=56
2021-12-07 15:12:14.065 21740-23717/: onFrameAvailable
2021-12-07 15:12:14.067 21740-23717/: onRendering frameIndex=55
2021-12-07 15:12:14.176 21740-24903/: onDecoding decodeIndex=56
2021-12-07 15:12:14.176 21740-24903/: onVideoRender
2021-12-07 15:12:14.176 21740-24903/: decode frameIndex=57
2021-12-07 15:12:14.178 21740-23717/: onFrameAvailable
2021-12-07 15:12:14.180 21740-23717/: onRendering frameIndex=56
2021-12-07 15:12:14.286 21740-24903/: onDecoding decodeIndex=57
2021-12-07 15:12:14.286 21740-24903/: onVideoRender
2021-12-07 15:12:14.286 21740-24903/: decode frameIndex=58
2021-12-07 15:12:14.287 21740-23717/: onFrameAvailable
2021-12-07 15:12:14.288 21740-23717/: onRendering frameIndex=57
2021-12-07 15:12:14.400 21740-24903/: onDecoding decodeIndex=58
2021-12-07 15:12:14.400 21740-24903/: onVideoRender
2021-12-07 15:12:14.400 21740-24903/: decode frameIndex=59
2021-12-07 15:12:14.400 21740-23717/: onFrameAvailable
2021-12-07 15:12:14.401 21740-23717/: onRendering frameIndex=58
2021-12-07 15:12:14.510 21740-23717/: onFrameAvailable
2021-12-07 15:12:14.511 21740-24903/: onDecoding decodeIndex=59
2021-12-07 15:12:14.511 21740-24903/: onVideoRender
2021-12-07 15:12:14.511 21740-24903/: decode frameIndex=60
2021-12-07 15:12:14.511 21740-23717/: onRendering frameIndex=59
2021-12-07 15:12:14.620 21740-23717/: onFrameAvailable
2021-12-07 15:12:14.622 21740-23717/: onRendering frameIndex=60
2021-12-07 15:12:14.622 21740-24903/: onDecoding decodeIndex=60
2021-12-07 15:12:14.622 21740-24903/: onVideoRender
2021-12-07 15:12:14.622 21740-24903/: decode frameIndex=61
2021-12-07 15:12:14.624 21740-24903/: onDecoding decodeIndex=61
2021-12-07 15:12:14.624 21740-24903/: onVideoRender
2021-12-07 15:12:14.624 21740-24903/: decode frameIndex=62
2021-12-07 15:12:14.633 21740-23717/: release
2021-12-07 15:12:14.689 21740-23717/: onRelease
2021-12-07 15:12:14.689 21740-23717/: onVideoComplete
2021-12-07 15:12:14.690 21740-21740/: onSurfaceTextureDestroyed
2021-12-07 15:12:14.690 21740-21740/: AnimPlayer onSurfaceTextureDestroyed
2021-12-07 15:12:14.690 21740-21740/: HardDecoder destroy
2021-12-07 15:12:14.690 21740-21740/: HardDecoder destroyInner
2021-12-07 15:12:14.692 21740-23717/: onVideoComplete:
2021-12-07 15:12:14.696 21740-21740/: FileContainer init
2021-12-07 15:12:14.694 21740-23717/: HardDecoder destroyInner
2021-12-07 15:12:14.697 21740-23717/: onDestroy
2021-12-07 15:12:14.700 21740-23717/: onVideoDestroy
2021-12-07 15:12:14.700 21740-23717/: onVideoDestroy:
2021-12-07 15:12:14.701 21740-23717/: parseConfig cost=2ms enableVersion1=false result=true
2021-12-07 15:12:14.701 21740-23717/: onConfigCreate
2021-12-07 15:12:14.701 21740-23717/: parse AnimConfig(version=2, totalFrames=61, width=640, height=1139, videoWidth=976, videoHeight=1152, orien=0, fps=9, isMix=false, alphaPointRect=PointRect(x=644, y=0, w=320, h=569), rgbPointRect=PointRect(x=0, y=0, w=640, h=1139), isDefaultConfig=false)
2021-12-07 15:12:14.701 21740-23717/: innerStartPlay
2021-12-07 15:12:14.701 21740-23717/: prepareTextureView
2021-12-07 15:12:14.702 21740-23717/: onDestroy
2021-12-07 15:12:14.702 21740-23717/: onVideoDestroy
2021-12-07 15:12:14.702 21740-23717/: onVideoDestroy:
2021-12-07 15:12:14.714 21740-21740/: prepareTextureViewRunnable
2021-12-07 15:12:14.715 21740-21740/: scaleType=CENTER_CROP

这是复现的日志,没有看到onSurfaceTextureAvailable的调用,是这里的原因吗

@hexleo
Copy link
Collaborator

hexleo commented Dec 7, 2021

你的vap版本是多少?
你这从销毁到再次播放,时间很短,你是怎么调用再次播放的?
image

@zijinzhiyun
Copy link
Author

使用的是2.0.22版本,我会在每次onVideoComplete回调中开启新的播放文件

@zijinzhiyun
Copy link
Author

看wiki 上写的是需要等待onComplete的回调后,才能再次调用start进行播放。这么播放会有问题吗

@hexleo
Copy link
Collaborator

hexleo commented Dec 7, 2021

ALog.i(TAG, "onSurfaceTextureAvailable width=$width height=$height")
这个日志有打印出来吗?

@hexleo
Copy link
Collaborator

hexleo commented Dec 7, 2021

onSizeChange的日志有吗?
看看这个值返回多少?怀疑是布局参数错误,导致TextureView没有回调onSurfaceTextureAvailable
image

@zijinzhiyun
Copy link
Author

ALog.i(TAG, "onSurfaceTextureAvailable width=$width height=$height")这个日志没有打印出来
也没有onSizeChange的日志

@zijinzhiyun
Copy link
Author

我需要把再次播放的逻辑放到onVideoDestroy回调中吗

@hexleo
Copy link
Collaborator

hexleo commented Dec 7, 2021

正常在onVideoComplete就好,正常应该有onSizeChange的日志,没有这个回调是无法正常播放的,你可以确认下。我看日志你第一次应该是正常播放了才对,是第二次没有播放吧,第一次正常播放应该有onSizeChange的回调才对

@zijinzhiyun
Copy link
Author

zijinzhiyun commented Dec 7, 2021

是的,第一次有onSizeChange回调
2021-12-07 17:33:30.529 24333-24333 E/AnimPlayer.AnimView: onAttachedToWindow
2021-12-07 17:33:30.565 24333-24333 E/AnimPlayer.AnimView: onSizeChanged w=1080, h=2244
第一次之后正常播放也没有回调,播放的都是同一个文件,播了好多次之后,就有可能会有问题

@zijinzhiyun
Copy link
Author

@hexleo 找到原因了
播放完成后,HardDecoder.destroyInner()方法会被HardDecoder.release和HardDecoder.destroy()调用,HardDecoder.destroyInner()会调用两次renderThread.handler?.post,handler中队列会有两条message,会执行两次onVideoDestroy(),onVideoDestroy()中又会执行AnimView.hide(),hide()中又会handler.post一个消息removeAllViews()。AnimView.prepareTextureView()会post一个prepareTextureViewRunnable,prepareTextureViewRunnable中执行addView(innerTextureView)后,刚好触发hide()中post的removeAllViews(),innerTextureView就被移除了,onSurfaceTextureAvailable()就不会被回调,就会再也不能播放了

@hexleo
Copy link
Collaborator

hexleo commented Dec 8, 2021

了解,我确认下问题,看如何修复

@hexleo
Copy link
Collaborator

hexleo commented Dec 8, 2021

你切换到这个分支 bugfix/android_destroy_inner 先验证下,我没重现你的问题,但确实会出现你说的那种情况,应该是标志位没设置正确导致。你验证没问题了我再发新版本

@zijinzhiyun
Copy link
Author

我目前测试没有复现了

@hexleo hexleo closed this as completed in 042785c Dec 9, 2021
hexleo added a commit that referenced this issue Dec 9, 2021
bug: 解决偶现无法再次播放问题 close #180
@hexleo
Copy link
Collaborator

hexleo commented Dec 9, 2021

在2.0.23修复了这个问题

@zijinzhiyun
Copy link
Author

感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants