aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-15 14:34:23 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-15 14:34:32 +0100
commiteaf1f01169357bf11883d1a7d9f0e6bbf62b26d8 (patch)
tree8aa86de2d8bc3fa2ae64d7a69cc84f79e384724e
parentf6badba1859fb266a9c0bdaf006a04c73873cd90 (diff)
parentd0fe217e3990b003b3b3f2c2daaadfb2af590def (diff)
downloadffmpeg-eaf1f01169357bf11883d1a7d9f0e6bbf62b26d8.tar.gz
Merge commit 'd0fe217e3990b003b3b3f2c2daaadfb2af590def'
* commit 'd0fe217e3990b003b3b3f2c2daaadfb2af590def': rtpdec: Simplify insertion into the linked list queue rtpdec: Remove a woefully misplaced comment Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/rtpdec.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 44730fd0da..0cfb74f175 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -50,7 +50,6 @@ static RTPDynamicProtocolHandler opus_dynamic_handler = {
.codec_id = AV_CODEC_ID_OPUS,
};
-/* statistics functions */
static RTPDynamicProtocolHandler *rtp_first_dynamic_payload_handler = NULL;
void ff_register_dynamic_payload_handler(RTPDynamicProtocolHandler *handler)
@@ -727,15 +726,14 @@ void ff_rtp_reset_packet_queue(RTPDemuxContext *s)
static void enqueue_packet(RTPDemuxContext *s, uint8_t *buf, int len)
{
uint16_t seq = AV_RB16(buf + 2);
- RTPPacket *cur = s->queue, *prev = NULL, *packet;
+ RTPPacket **cur = &s->queue, *packet;
/* Find the correct place in the queue to insert the packet */
- while (cur) {
- int16_t diff = seq - cur->seq;
+ while (*cur) {
+ int16_t diff = seq - (*cur)->seq;
if (diff < 0)
break;
- prev = cur;
- cur = cur->next;
+ cur = &(*cur)->next;
}
packet = av_mallocz(sizeof(*packet));
@@ -745,11 +743,8 @@ static void enqueue_packet(RTPDemuxContext *s, uint8_t *buf, int len)
packet->seq = seq;
packet->len = len;
packet->buf = buf;
- packet->next = cur;
- if (prev)
- prev->next = packet;
- else
- s->queue = packet;
+ packet->next = *cur;
+ *cur = packet;
s->queue_len++;
}