diff options
author | Anton Khirnov <wyskas@gmail.com> | 2008-08-06 04:17:47 +0400 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2008-08-06 04:17:47 +0400 |
commit | b87025399c0aa3e3f17a6cf46d4fc751e799b6f1 (patch) | |
tree | 648fd10ef10dfe5299b154f7057fbfc8d73e347e /libavformat | |
parent | 77c3fb9098cf73336bab34c2f78f50d8f3575038 (diff) |
matroskadec: replace matroska_queue_packet with a single call to dynarray_add
patch by Anton Khirnov wyskas _at_ gmail _dot_ com
Originally committed as revision 14632 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/matroskadec.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 83aa324954..23fea470dc 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1268,19 +1268,6 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) } /* - * 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 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, + 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 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, pkt->pos = pos; pkt->duration = duration; - matroska_queue_packet(matroska, pkt); + dynarray_add(&matroska->packets, &matroska->num_packets, pkt); } if (timecode != AV_NOPTS_VALUE) |