1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

rtpenc_xiph: Use AV_WB16 instead of manual bitshifts

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö
2015-02-26 13:42:43 +02:00
parent d16c8d28d4
commit 7c1e2e6466

View File

@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "libavutil/intreadwrite.h"
#include "avformat.h" #include "avformat.h"
#include "rtpenc.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) if (s->num_frames > 1)
q = s->buf_ptr; // jump ahead if needed q = s->buf_ptr; // jump ahead if needed
*q++ = (size >> 8) & 0xff; AV_WB16(q, size);
*q++ = size & 0xff; q += 2;
memcpy(q, buff, size); memcpy(q, buff, size);
q += size; q += size;
s->buf_ptr = q; s->buf_ptr = q;
@@ -113,8 +115,8 @@ void ff_rtp_send_xiph(AVFormatContext *s1, const uint8_t *buff, int size)
// set packet headers // set packet headers
*q++ = (frag << 6) | (xdt << 4); // num_frames = 0 *q++ = (frag << 6) | (xdt << 4); // num_frames = 0
*q++ = (len >> 8) & 0xff; AV_WB16(q, len);
*q++ = len & 0xff; q += 2;
// set packet body // set packet body
memcpy(q, buff, len); memcpy(q, buff, len);
q += len; q += len;