Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnssi Hannula <anssi.hannula@iki.fi>2015-10-15 13:42:38 +0300
committerAnssi Hannula <anssi.hannula@iki.fi>2015-10-15 15:04:00 +0300
commitfd74d45d5158812675105a3b4aeb29c67b82f7e8 (patch)
treeaccdb9a2bd2d42286eac1845a0060c0955b73a65 /libavformat
parent6e719dc6bb64d37c0b47f8c3387aa572e0a4780a (diff)
avformat/hls: fix segment selection regression on track changes of live streams
Commit ad701326b43078b90 ("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.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/hls.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c
index ff95519fb3..3c073e0c28 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -1602,6 +1602,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];