Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
2e814d03
Commit
2e814d03
authored
Jan 09, 2013
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtpenc: Simplify code by introducing a macro for rescaling NTP timestamps
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
45dd1ae1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
rtp.h
libavformat/rtp.h
+3
-0
rtpenc.c
libavformat/rtpenc.c
+1
-2
No files found.
libavformat/rtp.h
View file @
2e814d03
...
...
@@ -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 */
libavformat/rtpenc.c
View file @
2e814d03
...
...
@@ -273,8 +273,7 @@ static void rtcp_send_sr(AVFormatContext *s1, int64_t ntp_time)
avio_w8
(
s1
->
pb
,
RTCP_SR
);
avio_wb16
(
s1
->
pb
,
6
);
/* length in words - 1 */
avio_wb32
(
s1
->
pb
,
s
->
ssrc
);
avio_wb32
(
s1
->
pb
,
ntp_time
/
1000000
);
avio_wb32
(
s1
->
pb
,
((
ntp_time
%
1000000
)
<<
32
)
/
1000000
);
avio_wb64
(
s1
->
pb
,
NTP_TO_RTP_FORMAT
(
ntp_time
));
avio_wb32
(
s1
->
pb
,
rtp_ts
);
avio_wb32
(
s1
->
pb
,
s
->
packet_count
);
avio_wb32
(
s1
->
pb
,
s
->
octet_count
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment