예제 #1
0
static void 
fillStreamBlock_mp3(SWFSoundStream stream, SWFSoundStreamBlock block)
{
	int delay, wanted;

	/* see how many frames we can put in this block,
	 see how big they are */
	block->delay = stream->delay;
	delay = stream->delay + stream->samplesPerFrame;
	wanted = delay;
	block->length = getMP3Samples(stream->source.mp3.input, stream->flags, &delay);
	block->numSamples = delay;
	if(block->length <= 0)
	{
		stream->isFinished = TRUE;
		SWFSoundStream_rewind(stream);
	}
	stream->delay = wanted - delay;
}
예제 #2
0
파일: soundstream.c 프로젝트: cran/R2SWF
static void 
fillStreamBlock_mp3(SWFSoundStream stream, SWFSoundStreamBlock block)
{
	int delay, wanted;
	static const int maxSC = 65535;

	/* see how many frames we can put in this block,
	 see how big they are */
	block->delay = stream->delay;
	delay = stream->delay + stream->samplesPerFrame;
	wanted = delay;
	block->length = getMP3Samples(stream->source.mp3.input, stream->flags, &delay);
	block->numSamples = delay;
	
	if ( block->numSamples > maxSC ) {
		SWF_warn("fillStreamBlock_mp3: number of samples in block (%d) exceed max allowed value of %d\n", block->numSamples, maxSC);
	}
	if(block->length <= 0)
	{
		stream->isFinished = TRUE;
		SWFSoundStream_rewind(stream);
	}
	stream->delay = wanted - delay;
}