increase the nb_samples because some large video may overflow.

pull/746/merge
winlin 8 years ago
parent 3fe338d1c5
commit 2ef1ef06e9

@ -353,10 +353,9 @@ int SrsCodecSample::add_sample_unit(char* bytes, int size)
{
int ret = ERROR_SUCCESS;
if (nb_sample_units >= SRS_SRS_MAX_CODEC_SAMPLE) {
if (nb_sample_units >= SRS_MAX_CODEC_SAMPLE) {
ret = ERROR_HLS_DECODE_ERROR;
srs_error("hls decode samples error, "
"exceed the max count: %d, ret=%d", SRS_SRS_MAX_CODEC_SAMPLE, ret);
srs_error("avc exceed samples count, max=%d, video=%d. ret=%d", SRS_MAX_CODEC_SAMPLE, is_video, ret);
return ret;
}

@ -243,9 +243,12 @@ extern int flv_sample_rates[];
*/
extern int aac_sample_rates[];
#define SRS_SRS_MAX_CODEC_SAMPLE 128
// The impossible aac sample rate index.
#define SRS_AAC_SAMPLE_RATE_UNSET 15
// The max number of NALUs in a video, or aac frame in audio packet.
#define SRS_MAX_CODEC_SAMPLE 256
/**
* the FLV/RTMP supported audio sample size.
* Size of each audio sample. This parameter only pertains to
@ -368,7 +371,7 @@ public:
* where avc/h264 video packet may contains multiple buffer.
*/
int nb_sample_units;
SrsCodecSampleUnit sample_units[SRS_SRS_MAX_CODEC_SAMPLE];
SrsCodecSampleUnit sample_units[SRS_MAX_CODEC_SAMPLE];
public:
/**
* whether the sample is video sample which demux from video packet.

Loading…
Cancel
Save