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

现在播放hls,rtmp视频的时候,网络变化断开,播放器执行的不是error方法,而是complete #653

Open
lyqaiym opened this issue Nov 16, 2015 · 7 comments

Comments

@lyqaiym
Copy link

lyqaiym commented Nov 16, 2015

在ff_ffplay.c中read_thread方法里
if ((!is->paused || completed) &&
(!is->audio_st || (is->auddec.finished == is->audioq.serial && frame_queue_nb_remaining(&is->sampq) == 0)) &&
(!is->video_st || (is->viddec.finished == is->videoq.serial && frame_queue_nb_remaining(&is->pictq) == 0))) {
会判断是不是完成
if (ffp->error) {
av_log(ffp, AV_LOG_INFO, "ffp_toggle_buffering: error: %d\n", ffp->error);
ffp_notify_msg1(ffp, FFP_MSG_ERROR);
} else {
ffp_notify_msg1(ffp, FFP_MSG_COMPLETED);
}
在播放hls,rtmp视频,网络出异常ffp->error是0.所以走的是完成。
但是用int sockerr = errno;得到错误吗。会是>0的数。
以至于不知道视频是不是播放完成

@bbcallen
Copy link
Contributor

Yes, it's a known problem.

@bbcallen bbcallen added the bug label Nov 16, 2015
@lyqaiym
Copy link
Author

lyqaiym commented Nov 16, 2015

目前最快的办法就是用errno
int sockerr = errno;
av_log(ffp, AV_LOG_INFO, "ffp_toggle_buffering: completed: OK,sockerr=%d,%s\n",sockerr, strerror(sockerr));
if(sockerr==EAGAIN||sockerr==ENETUNREACH){
ffp_notify_msg1(ffp, FFP_MSG_ERROR);
}else{
ffp_notify_msg1(ffp, FFP_MSG_COMPLETED);
}

@fengyanjava
Copy link

我也遇到了这个问题。

@Fanping
Copy link

Fanping commented Feb 17, 2017

计划修复么? @bbcallen 或者 @lyqaiym @fengyanjava 有找到适当的解决方案吗?

@helloworldcm
Copy link

@lyqaiym 请问这个需要怎么解决呢.

@annidy
Copy link

annidy commented Sep 30, 2018

这里有解决方案
https://www.jianshu.com/p/6e450d02599c

@heistings
Copy link

这里有解决方案
https://www.jianshu.com/p/6e450d02599c

这个方案有问题。还有很多没考虑到的点。

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

No branches or pull requests

7 participants