# HG changeset patch # User aurel # Date 1217981867 0 # Node ID 5825a6cfd3bdd5545d367b6a4bb213b2b70ab062 # Parent 191f342eb840d0691d6eaedc20763dd14f4b4e09 matroskadec: replace matroska_queue_packet with a single call to dynarray_add patch by Anton Khirnov wyskas _at_ gmail _dot_ com diff -r 191f342eb840 -r 5825a6cfd3bd matroskadec.c --- a/matroskadec.c Tue Aug 05 21:46:10 2008 +0000 +++ b/matroskadec.c Wed Aug 06 00:17:47 2008 +0000 @@ -1268,19 +1268,6 @@ } /* - * Put a packet into our internal queue. Will be delivered to the - * user/application during the next get_packet() call. - */ -static void matroska_queue_packet(MatroskaDemuxContext *matroska, AVPacket *pkt) -{ - matroska->packets = - av_realloc(matroska->packets, (matroska->num_packets + 1) * - sizeof(AVPacket *)); - matroska->packets[matroska->num_packets] = pkt; - matroska->num_packets++; -} - -/* * Put one packet in an application-supplied AVPacket struct. * Returns 0 on success or -1 on failure. */ @@ -1484,7 +1471,7 @@ + a * (h*w / a - track->audio.pkt_cnt--), a); pkt->pos = pos; pkt->stream_index = st->index; - matroska_queue_packet(matroska, pkt); + dynarray_add(&matroska->packets,&matroska->num_packets,pkt); } } else { MatroskaTrackEncoding *encodings = track->encodings.elem; @@ -1520,7 +1507,7 @@ pkt->pos = pos; pkt->duration = duration; - matroska_queue_packet(matroska, pkt); + dynarray_add(&matroska->packets, &matroska->num_packets, pkt); } if (timecode != AV_NOPTS_VALUE)