bilibili / bilibili/ijkplayer

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

Open
#653 7 comments 0 reactions 0 assignees View on GitHub
bug not-on-plan
Dominant language
C
Stars
33.2k
Forks
8.2k
PR merge metrics
No merged PRs in 30d

Description

在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的数。
以至于不知道视频是不是播放完成

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in ff_ffplay.c at the read_thread completion check and inspect how network failures set ffp->error. Compare errno from the socket failure with the FFP_MSG_ERROR and FFP_MSG_COMPLETED notification paths for HLS and RTMP playback. Done means a network interruption is distinguishable from normal playback completion and the appropriate notification is sent.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
audio-video-rtc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.