summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2011-12-09 20:42:52 +0200
committerMartin Storsjö <martin@martin.st>2011-12-11 01:37:26 +0200
commit4dbac18e2e43e35fe528b1ce4370b2d9dc06779f (patch)
treef67b9e822aa32a9add9777640e497a5c494f023e /libavformat
parente2484fb644b8dc0a0704e4155100c897e6e9739c (diff)
rtpenc: Simplify code by introducing a separate end pointer
Also remove redundant parentheses. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/rtpenc_h264.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/rtpenc_h264.c b/libavformat/rtpenc_h264.c
index 9ca6f7f68e..1a486cf96e 100644
--- a/libavformat/rtpenc_h264.c
+++ b/libavformat/rtpenc_h264.c
@@ -62,17 +62,17 @@ static void nal_send(AVFormatContext *s1, const uint8_t *buf, int size, int last
void ff_rtp_send_h264(AVFormatContext *s1, const uint8_t *buf1, int size)
{
- const uint8_t *r;
+ const uint8_t *r, *end = buf1 + size;
RTPMuxContext *s = s1->priv_data;
s->timestamp = s->cur_timestamp;
- r = ff_avc_find_startcode(buf1, buf1 + size);
- while (r < buf1 + size) {
+ r = ff_avc_find_startcode(buf1, end);
+ while (r < end) {
const uint8_t *r1;
while(!*(r++));
- r1 = ff_avc_find_startcode(r, buf1 + size);
- nal_send(s1, r, r1 - r, (r1 == buf1 + size));
+ r1 = ff_avc_find_startcode(r, end);
+ nal_send(s1, r, r1 - r, r1 == end);
r = r1;
}
}