comparison mms.c @ 6376:91076395b8d3 libavformat

Remove use of MAX_STREAMS in MMSContext->streams[] array. Instead, dynamically allocate the array.
author rbultje
date Fri, 13 Aug 2010 17:30:01 +0000
parents 256e51c4f44b
children
comparison
equal deleted inserted replaced
6375:256e51c4f44b 6376:91076395b8d3
97 //The second condition is for checking CS_PKT_STREAM_ID_REQUEST packet size, 97 //The second condition is for checking CS_PKT_STREAM_ID_REQUEST packet size,
98 //we can calcuate the packet size by stream_num. 98 //we can calcuate the packet size by stream_num.
99 //Please see function send_stream_selection_request(). 99 //Please see function send_stream_selection_request().
100 if (mms->stream_num < MAX_STREAMS && 100 if (mms->stream_num < MAX_STREAMS &&
101 46 + mms->stream_num * 6 < sizeof(mms->out_buffer)) { 101 46 + mms->stream_num * 6 < sizeof(mms->out_buffer)) {
102 mms->streams = av_fast_realloc(mms->streams,
103 &mms->nb_streams_allocated,
104 (mms->stream_num + 1) * sizeof(MMSStream));
102 mms->streams[mms->stream_num].id = stream_id; 105 mms->streams[mms->stream_num].id = stream_id;
103 mms->stream_num++; 106 mms->stream_num++;
104 } else { 107 } else {
105 av_log(NULL, AV_LOG_ERROR, 108 av_log(NULL, AV_LOG_ERROR,
106 "Corrupt stream (too many A/V streams)\n"); 109 "Corrupt stream (too many A/V streams)\n");