1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

Merge commit '6df9d9b55d3f56ee7782639a7678eeeaf77f14ea'

* commit '6df9d9b55d3f56ee7782639a7678eeeaf77f14ea':
  lavf: Use av_gettime_relative

Conflicts:
	libavformat/hls.c

See: f78bc96b7c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-10-24 12:40:08 +02:00
commit 2c5ae57776
5 changed files with 17 additions and 17 deletions

View File

@ -666,7 +666,7 @@ static int parse_playlist(HLSContext *c, const char *url,
}
}
if (pls)
pls->last_load_time = av_gettime();
pls->last_load_time = av_gettime_relative();
fail:
av_free(new_url);
@ -1035,7 +1035,7 @@ restart:
reload:
if (!v->finished &&
av_gettime() - v->last_load_time >= reload_interval) {
av_gettime_relative() - v->last_load_time >= reload_interval) {
if ((ret = parse_playlist(c, v->url, v, NULL)) < 0) {
av_log(v->parent, AV_LOG_WARNING, "Failed to reload playlist %d\n",
v->index);
@ -1055,7 +1055,7 @@ reload:
if (v->cur_seq_no >= v->start_seq_no + v->n_segments) {
if (v->finished)
return AVERROR_EOF;
while (av_gettime() - v->last_load_time < reload_interval) {
while (av_gettime_relative() - v->last_load_time < reload_interval) {
if (ff_check_interrupt(c->interrupt_callback))
return AVERROR_EXIT;
av_usleep(100*1000);
@ -1198,7 +1198,7 @@ static int select_cur_seq_no(HLSContext *c, struct playlist *pls)
int seq_no;
if (!pls->finished && !c->first_packet &&
av_gettime() - pls->last_load_time >= default_reload_interval(pls))
av_gettime_relative() - pls->last_load_time >= default_reload_interval(pls))
/* reload the playlist since it was suspended */
parse_playlist(c, pls->url, pls, NULL);

View File

@ -169,7 +169,7 @@ static int parse_playlist(URLContext *h, const char *url)
}
}
}
s->last_load_time = av_gettime();
s->last_load_time = av_gettime_relative();
fail:
avio_close(in);
@ -273,7 +273,7 @@ start:
s->target_duration;
retry:
if (!s->finished) {
int64_t now = av_gettime();
int64_t now = av_gettime_relative();
if (now - s->last_load_time >= reload_interval) {
if ((ret = parse_playlist(h, s->playlisturl)) < 0)
return ret;
@ -292,7 +292,7 @@ retry:
if (s->cur_seq_no - s->start_seq_no >= s->n_segments) {
if (s->finished)
return AVERROR_EOF;
while (av_gettime() - s->last_load_time < reload_interval) {
while (av_gettime_relative() - s->last_load_time < reload_interval) {
if (ff_check_interrupt(&h->interrupt_callback))
return AVERROR_EXIT;
av_usleep(100*1000);

View File

@ -143,7 +143,7 @@ static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf,
return AVERROR_INVALIDDATA;
}
s->last_rtcp_reception_time = av_gettime();
s->last_rtcp_reception_time = av_gettime_relative();
s->last_rtcp_ntp_time = AV_RB64(buf + 8);
s->last_rtcp_timestamp = AV_RB32(buf + 16);
if (s->first_rtcp_ntp_time == AV_NOPTS_VALUE) {
@ -323,7 +323,7 @@ int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, URLContext *fd,
avio_wb32(pb, 0); /* delay since last SR */
} else {
uint32_t middle_32_bits = s->last_rtcp_ntp_time >> 16; // this is valid, right? do we need to handle 64 bit values special?
uint32_t delay_since_last = av_rescale(av_gettime() - s->last_rtcp_reception_time,
uint32_t delay_since_last = av_rescale(av_gettime_relative() - s->last_rtcp_reception_time,
65536, AV_TIME_BASE);
avio_wb32(pb, middle_32_bits); /* last SR timestamp */
@ -448,7 +448,7 @@ int ff_rtp_send_rtcp_feedback(RTPDemuxContext *s, URLContext *fd,
/* Send new feedback if enough time has elapsed since the last
* feedback packet. */
now = av_gettime();
now = av_gettime_relative();
if (s->last_feedback_time &&
(now - s->last_feedback_time) < MIN_FEEDBACK_INTERVAL)
return 0;
@ -691,7 +691,7 @@ static void enqueue_packet(RTPDemuxContext *s, uint8_t *buf, int len)
packet = av_mallocz(sizeof(*packet));
if (!packet)
return;
packet->recvtime = av_gettime();
packet->recvtime = av_gettime_relative();
packet->seq = seq;
packet->len = len;
packet->buf = buf;
@ -769,7 +769,7 @@ static int rtp_parse_one_packet(RTPDemuxContext *s, AVPacket *pkt,
}
if (s->st) {
int64_t received = av_gettime();
int64_t received = av_gettime_relative();
uint32_t arrival_ts = av_rescale_q(received, AV_TIME_BASE_Q,
s->st->time_base);
timestamp = AV_RB32(buf + 4);

View File

@ -1183,7 +1183,7 @@ start:
}
ffurl_write(rt->rtsp_hd_out, ptr, strlen(ptr));
rt->last_cmd_time = av_gettime();
rt->last_cmd_time = av_gettime_relative();
/* Even if the request from the server had data, it is not the data
* that the caller wants or expects. The memory could also be leaked
* if the actual following reply has content data. */
@ -1280,7 +1280,7 @@ static int rtsp_send_cmd_with_content_async(AVFormatContext *s,
}
ffurl_write(rt->rtsp_hd_out, send_content, send_content_length);
}
rt->last_cmd_time = av_gettime();
rt->last_cmd_time = av_gettime_relative();
return 0;
}
@ -1858,7 +1858,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
for (;;) {
if (ff_check_interrupt(&s->interrupt_callback))
return AVERROR_EXIT;
if (wait_end && wait_end - av_gettime() < 0)
if (wait_end && wait_end - av_gettime_relative() < 0)
return AVERROR(EAGAIN);
max_p = 0;
if (rt->rtsp_hd) {
@ -2057,7 +2057,7 @@ redo:
break;
case RTSP_LOWER_TRANSPORT_CUSTOM:
if (first_queue_st && rt->transport == RTSP_TRANSPORT_RTP &&
wait_end && wait_end < av_gettime())
wait_end && wait_end < av_gettime_relative())
len = AVERROR(EAGAIN);
else
len = ffio_read_partial(s->pb, rt->recvbuf, RECVBUF_SIZE);

View File

@ -887,7 +887,7 @@ retry:
if (!(rt->rtsp_flags & RTSP_FLAG_LISTEN)) {
/* send dummy request to keep TCP connection alive */
if ((av_gettime() - rt->last_cmd_time) / 1000000 >= rt->timeout / 2 ||
if ((av_gettime_relative() - rt->last_cmd_time) / 1000000 >= rt->timeout / 2 ||
rt->auth_state.stale) {
if (rt->server_type == RTSP_SERVER_WMS ||
(rt->server_type != RTSP_SERVER_REAL &&