aboutsummaryrefslogtreecommitdiff
path: root/libavformat/mxfenc.c
diff options
context:
space:
mode:
authorBaptiste Coudurier2010-01-29 06:38:00 +0000
committerBaptiste Coudurier2010-01-29 06:38:00 +0000
commit012dc2c426e02b688837d3d7477da55f4db032e6 (patch)
tree509d6963ffb35a1049d679eef3f18c1992ad4e37 /libavformat/mxfenc.c
parent402d55eef16a3eabf3833a7ff21fcb0bb907c5f7 (diff)
Remove MAX_STREAMS usage in ogg and mxf muxers
Originally committed as revision 21526 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mxfenc.c')
-rw-r--r--libavformat/mxfenc.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 12dedccbbd..766327ded3 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -1807,22 +1807,13 @@ static int mxf_write_footer(AVFormatContext *s)
static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush)
{
- AVPacketList *pktl;
- int stream_count = 0;
- int streams[MAX_STREAMS];
-
- memset(streams, 0, sizeof(streams));
- pktl = s->packet_buffer;
- while (pktl) {
- //av_log(s, AV_LOG_DEBUG, "show st:%d dts:%lld\n", pktl->pkt.stream_index, pktl->pkt.dts);
- if (!streams[pktl->pkt.stream_index])
- stream_count++;
- streams[pktl->pkt.stream_index]++;
- pktl = pktl->next;
- }
+ int i, stream_count = 0;
+
+ for (i = 0; i < s->nb_streams; i++)
+ stream_count += !!s->streams[i]->last_in_packet_buffer;
if (stream_count && (s->nb_streams == stream_count || flush)) {
- pktl = s->packet_buffer;
+ AVPacketList *pktl = s->packet_buffer;
if (s->nb_streams != stream_count) {
AVPacketList *last = NULL;
// find last packet in edit unit