Commit eaf1f011 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'd0fe217e'

* commit 'd0fe217e':
  rtpdec: Simplify insertion into the linked list queue
  rtpdec: Remove a woefully misplaced comment
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents f6badba1 d0fe217e
...@@ -50,7 +50,6 @@ static RTPDynamicProtocolHandler opus_dynamic_handler = { ...@@ -50,7 +50,6 @@ static RTPDynamicProtocolHandler opus_dynamic_handler = {
.codec_id = AV_CODEC_ID_OPUS, .codec_id = AV_CODEC_ID_OPUS,
}; };
/* statistics functions */
static RTPDynamicProtocolHandler *rtp_first_dynamic_payload_handler = NULL; static RTPDynamicProtocolHandler *rtp_first_dynamic_payload_handler = NULL;
void ff_register_dynamic_payload_handler(RTPDynamicProtocolHandler *handler) void ff_register_dynamic_payload_handler(RTPDynamicProtocolHandler *handler)
...@@ -727,15 +726,14 @@ void ff_rtp_reset_packet_queue(RTPDemuxContext *s) ...@@ -727,15 +726,14 @@ void ff_rtp_reset_packet_queue(RTPDemuxContext *s)
static void enqueue_packet(RTPDemuxContext *s, uint8_t *buf, int len) static void enqueue_packet(RTPDemuxContext *s, uint8_t *buf, int len)
{ {
uint16_t seq = AV_RB16(buf + 2); 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 */ /* Find the correct place in the queue to insert the packet */
while (cur) { while (*cur) {
int16_t diff = seq - cur->seq; int16_t diff = seq - (*cur)->seq;
if (diff < 0) if (diff < 0)
break; break;
prev = cur; cur = &(*cur)->next;
cur = cur->next;
} }
packet = av_mallocz(sizeof(*packet)); packet = av_mallocz(sizeof(*packet));
...@@ -745,11 +743,8 @@ static void enqueue_packet(RTPDemuxContext *s, uint8_t *buf, int len) ...@@ -745,11 +743,8 @@ static void enqueue_packet(RTPDemuxContext *s, uint8_t *buf, int len)
packet->seq = seq; packet->seq = seq;
packet->len = len; packet->len = len;
packet->buf = buf; packet->buf = buf;
packet->next = cur; packet->next = *cur;
if (prev) *cur = packet;
prev->next = packet;
else
s->queue = packet;
s->queue_len++; s->queue_len++;
} }
......
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