summaryrefslogtreecommitdiff
path: root/libavformat/rtp.h
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-01-09 18:55:52 +0200
committerMartin Storsjö <martin@martin.st>2013-07-31 21:12:34 +0300
commit2e814d0329aded98c811d0502839618f08642685 (patch)
tree677956cd1d3218da6ea9526756ada0ccb1490a24 /libavformat/rtp.h
parent45dd1ae1b3c18331f3db2293a9135bc5851e553f (diff)
rtpenc: Simplify code by introducing a macro for rescaling NTP timestamps
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtp.h')
-rw-r--r--libavformat/rtp.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/rtp.h b/libavformat/rtp.h
index f8d406ea88..feaf167965 100644
--- a/libavformat/rtp.h
+++ b/libavformat/rtp.h
@@ -23,6 +23,7 @@
#include "libavformat/avformat.h"
#include "libavcodec/avcodec.h"
+#include "libavutil/mathematics.h"
/**
* Return the payload type for a given stream used in the given format context.
@@ -109,4 +110,6 @@ enum RTCPType {
#define RTP_PT_IS_RTCP(x) (((x) >= RTCP_FIR && (x) <= RTCP_IJ) || \
((x) >= RTCP_SR && (x) <= RTCP_TOKEN))
+#define NTP_TO_RTP_FORMAT(x) av_rescale((x), INT64_C(1) << 32, 1000000)
+
#endif /* AVFORMAT_RTP_H */