summaryrefslogtreecommitdiff
path: root/libavformat/rtpenc_xiph.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2015-02-26 13:42:43 +0200
committerMartin Storsjö <martin@martin.st>2015-02-28 22:54:00 +0200
commit7c1e2e64667421f931ab48141517f19d309c7eea (patch)
treef7b4034f8a5b13533514a187445ce46109c2a344 /libavformat/rtpenc_xiph.c
parentd16c8d28d4e2fca3af1054ffbf635c8cee755fc8 (diff)
downloadffmpeg-7c1e2e64667421f931ab48141517f19d309c7eea.tar.gz
rtpenc_xiph: Use AV_WB16 instead of manual bitshifts
Signed-off-by: Martin Storsjö <martin@martin.st>
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 def3bc5ee5..ef31c048de 100644
--- a/libavformat/rtpenc_xiph.c
+++ b/libavformat/rtpenc_xiph.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/intreadwrite.h"
+
#include "avformat.h"
#include "rtpenc.h"
@@ -91,8 +93,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;
@@ -113,8 +115,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;