mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-30 13:50:50 +08:00
avformat/hls: fix segment selection regression on track changes of live streams
Commitad701326b4("avformat/hls: open playlists immediately when AVDISCARD_ALL is dropped") inadvertently caused first_packet to never be cleared, causing select_cur_seq_no() to not use the specific code for live streams. In practice this means that when the user selects a different audio track during live stream (i.e. non-VOD) playback, there may be some additional delay as the code might select an incorrect segment at first, and we have to wait for video to catch audio (if too late segment was selected) or to download more following audio segments (if too early segment was selected). Fix that by restoring the zeroing of first_packet. (cherry picked from commitfd74d45d51)
This commit is contained in:
committed by
Carl Eugen Hoyos
parent
6197d35a93
commit
e69d8fc619
@@ -1535,6 +1535,7 @@ static int hls_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
int ret, i, minplaylist = -1;
|
||||
|
||||
recheck_discard_flags(s, c->first_packet);
|
||||
c->first_packet = 0;
|
||||
|
||||
for (i = 0; i < c->n_playlists; i++) {
|
||||
struct playlist *pls = c->playlists[i];
|
||||
|
||||
Reference in New Issue
Block a user