summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
authorFred Rothganger <frothga@sandia.gov>2014-03-11 17:58:34 -0600
committerMichael Niedermayer <michaelni@gmx.at>2014-03-12 13:33:14 +0100
commit3f3229cd109f5cdf1f1d6fe26f2864e32e029b53 (patch)
tree4d0a2895c5ac1e1e3fc529a439f6b5d1b1ba6790 /libavformat/rtsp.c
parent581957cd8618f07d824da1b9f6ae1c97531b03ab (diff)
avformat: extracting NTP timestamp from RTCP
For muxing, it accepts both 0 and AV_NOPTS_VALUE. For demuxing, it will present AV_NOPTS_VALUE when start_time_realtime is unknown. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r--libavformat/rtsp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index d89af626da..fcf9eca0d4 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -2071,6 +2071,16 @@ redo:
st2->time_base);
}
}
+ // Make real NTP start time available in AVFormatContext
+ if (s->start_time_realtime == AV_NOPTS_VALUE) {
+ s->start_time_realtime = av_rescale (rtpctx->first_rtcp_ntp_time - (NTP_OFFSET << 32), 1000000, 1LL << 32);
+ if (rtpctx->st) {
+ s->start_time_realtime -=
+ av_rescale (rtpctx->rtcp_ts_offset,
+ (uint64_t) rtpctx->st->time_base.num * 1000000,
+ rtpctx->st->time_base.den);
+ }
+ }
}
if (ret == -RTCP_BYE) {
rt->nb_byes++;