Commit cfe33c98 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '1fc64e2e'

* commit '1fc64e2e':
  rtpenc: Write conditional statements on separate lines
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents ba069e08 1fc64e2e
......@@ -223,7 +223,8 @@ static int rtp_write_header(AVFormatContext *s1)
break;
case AV_CODEC_ID_VORBIS:
case AV_CODEC_ID_THEORA:
if (!s->max_frames_per_packet) s->max_frames_per_packet = 15;
if (!s->max_frames_per_packet)
s->max_frames_per_packet = 15;
s->max_frames_per_packet = av_clip(s->max_frames_per_packet, 1, 15);
s->max_payload_size -= 6; // ident+frag+tdt/vdt+pkt_num+pkt_length
s->num_frames = 0;
......
......@@ -82,14 +82,16 @@ void ff_rtp_send_xiph(AVFormatContext *s1, const uint8_t *buff, int size)
}
// buffer current frame to send later
if (0 == s->num_frames) s->timestamp = s->cur_timestamp;
if (0 == s->num_frames)
s->timestamp = s->cur_timestamp;
s->num_frames++;
// Set packet header. Normally, this is OR'd with frag and xdt,
// but those are zero, so omitted here
*q++ = s->num_frames;
if (s->num_frames > 1) q = s->buf_ptr; // jump ahead if needed
if (s->num_frames > 1)
q = s->buf_ptr; // jump ahead if needed
*q++ = (size >> 8) & 0xff;
*q++ = size & 0xff;
memcpy(q, buff, size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment