summaryrefslogtreecommitdiff
path: root/libavformat/rtpenc_xiph.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-01 01:17:10 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-01 01:17:10 +0100
commit7e5300958885e8d7e81e4e0183580558183a9a5e (patch)
tree728a4ef5bef3154b6457b1f9d41ff001c8259b69 /libavformat/rtpenc_xiph.c
parent41b8d154aa542f8b8cb02f0e7626081fa9ace9ec (diff)
parent7c1e2e64667421f931ab48141517f19d309c7eea (diff)
Merge commit '7c1e2e64667421f931ab48141517f19d309c7eea'
* commit '7c1e2e64667421f931ab48141517f19d309c7eea': rtpenc_xiph: Use AV_WB16 instead of manual bitshifts Conflicts: libavformat/rtpenc_xiph.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtpenc_xiph.c')
-rw-r--r--libavformat/rtpenc_xiph.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/rtpenc_xiph.c b/libavformat/rtpenc_xiph.c
index ba0b2189f9..d5936774ba 100644
--- a/libavformat/rtpenc_xiph.c
+++ b/libavformat/rtpenc_xiph.c
@@ -20,6 +20,8 @@
*/
#include "libavutil/avassert.h"
+#include "libavutil/intreadwrite.h"
+
#include "avformat.h"
#include "rtpenc.h"
@@ -92,8 +94,8 @@ void ff_rtp_send_xiph(AVFormatContext *s1, const uint8_t *buff, int size)
if (s->num_frames > 1)
q = s->buf_ptr; // jump ahead if needed
- *q++ = (size >> 8) & 0xff;
- *q++ = size & 0xff;
+ AV_WB16(q, size);
+ q += 2;
memcpy(q, buff, size);
q += size;
s->buf_ptr = q;
@@ -114,8 +116,8 @@ void ff_rtp_send_xiph(AVFormatContext *s1, const uint8_t *buff, int size)
// set packet headers
*q++ = (frag << 6) | (xdt << 4); // num_frames = 0
- *q++ = (len >> 8) & 0xff;
- *q++ = len & 0xff;
+ AV_WB16(q, len);
+ q += 2;
// set packet body
memcpy(q, buff, len);
q += len;