|
|
@ -376,7 +376,6 @@ static int read_data(void *opaque, uint8_t *buf, int buf_size) |
|
|
|
|
|
|
|
|
|
|
|
restart: |
|
|
|
restart: |
|
|
|
if (!v->input) { |
|
|
|
if (!v->input) { |
|
|
|
reload: |
|
|
|
|
|
|
|
/* If this is a live stream and the reload interval has elapsed since
|
|
|
|
/* If this is a live stream and the reload interval has elapsed since
|
|
|
|
* the last playlist reload, reload the variant playlists now. */ |
|
|
|
* the last playlist reload, reload the variant playlists now. */ |
|
|
|
int64_t reload_interval = v->n_segments > 0 ? |
|
|
|
int64_t reload_interval = v->n_segments > 0 ? |
|
|
@ -384,10 +383,16 @@ reload: |
|
|
|
v->target_duration; |
|
|
|
v->target_duration; |
|
|
|
reload_interval *= 1000000; |
|
|
|
reload_interval *= 1000000; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reload: |
|
|
|
if (!v->finished && |
|
|
|
if (!v->finished && |
|
|
|
av_gettime() - v->last_load_time >= reload_interval && |
|
|
|
av_gettime() - v->last_load_time >= reload_interval) { |
|
|
|
(ret = parse_playlist(c, v->url, v, NULL)) < 0) |
|
|
|
if ((ret = parse_playlist(c, v->url, v, NULL)) < 0) |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
|
|
|
|
/* If we need to reload the playlist again below (if
|
|
|
|
|
|
|
|
* there's still no more segments), switch to a reload |
|
|
|
|
|
|
|
* interval of half the target duration. */ |
|
|
|
|
|
|
|
reload_interval = v->target_duration * 500000; |
|
|
|
|
|
|
|
} |
|
|
|
if (v->cur_seq_no < v->start_seq_no) { |
|
|
|
if (v->cur_seq_no < v->start_seq_no) { |
|
|
|
av_log(NULL, AV_LOG_WARNING, |
|
|
|
av_log(NULL, AV_LOG_WARNING, |
|
|
|
"skipping %d segments ahead, expired from playlists\n", |
|
|
|
"skipping %d segments ahead, expired from playlists\n", |
|
|
|