IJKMediaPlayback.h 中的 @property(nonatomic) NSTimeInterval currentPlaybackTime;
我最近在做一个智能硬件,硬件是根据视频播放时间来执行动作的,我用一条线程来监控currentPlaybackTime, 发现视频播放在暂停后继续播放时currentPlaybackTime有跳变.
具体情况是:比如我暂停时currentPlaybackTime为52.194000, 继续播放时时间为111.872000,但是很快时间就恢复正常了,这个不正常的currentPlaybackTime大概会持续100ms, 这虽然影响不大,但我想这是一个bug.
下面是我的贴上的调试log, 有需要请对比playing前后的time值.
2016-06-20 09:43:29.085 [654:149705] index=1038 time=51.915000
2016-06-20 09:43:29.144 [654:149705] index=1039 time=51.973000
2016-06-20 09:43:29.196 [654:149705] index=1040 time=52.026000
2016-06-20 09:43:29.248 [654:149705] index=1041 time=52.078000
2016-06-20 09:43:29.308 [654:149705] index=1042 time=52.138000
ijkmp_pause()
ijkmp_pause()=0
2016-06-20 09:43:29.364 [654:149705] index=1043 time=52.194000
ijkmp_get_msg: FFP_REQ_PAUSE
aout_pause_audio(1)
2016-06-20 09:43:29.397 [654:149622] IJKMPMoviePlayBackStateDidChange 2: paused
ijkmp_start()
ijkmp_start()=0
ijkmp_get_msg: FFP_REQ_START
aout_pause_audio(0)
2016-06-20 09:44:29.035 [654:149622] IJKMPMoviePlayBackStateDidChange 1: playing
2016-06-20 09:44:29.042 [654:149705] index=2237 time=111.872000
2016-06-20 09:44:29.095 [654:149705] index=2238 time=111.925000
2016-06-20 09:44:29.168 [654:149705] index=1045 time=52.290000
2016-06-20 09:44:29.219 [654:149705] index=1046 time=52.341000
2016-06-20 09:44:29.281 [654:149705] index=1048 time=52.403000
2016-06-20 09:44:29.340 [654:149705] index=1049 time=52.462000
It's a known issue, and No good solution, for now.
my solution is #1019
@bbcallen @yuazhen
ok, thank you very much, I am very glad to get your response.
关注这个问题,用户体验感觉不是很好。 暂停后在恢复播放,进度会跳变下,打log发现是getCurrentPosition()的值有个跳动。
同样遇到这个问题,调试代码发现is->paused = is->audclk.paused = is->vidclk.paused = is->extclk.paused = pause_on;
音频时钟过早设置为 非暂停状态. 而此时 音频线程还未真正开始工作.此时调用 get_clock 返回时间就是 暂停到现在 经过的时间.c->pts_drift 保存的是暂停时,设置的值.
ffplay was designed in an asynchronous mode.
This issue will not be solved unless ijk abandon the ffplay.
You have to find some ugly workaround for this...
Most helpful comment
It's a known issue, and No good solution, for now.