Audio-Mad

 view release on metacpan or  search on metacpan

lib/Audio/Mad/Util.pm  view on Meta::CPAN

			next FRAME if ($stream->err_ok());

			## otherwise,  if we get an error due to and
			## end of buffer condition (BUFLEN),  or because 
			## the buffer was never set (BUFPTR) take action
			## to fill the buffer.
			if (
			    $stream->error == MAD_ERROR_BUFLEN || 
			    $stream->error == MAD_ERROR_BUFPTR
			) {
				## this is to capture the frame fragment at
				## the end of the buffer,  if we don't do this
				## we lose the frame.
				$buf = substr($buf, $stream->next_frame);
			
				## attempt to read more data onto the end of
				## the buffer,  we drop out of our loop at
				## the end of the file.
				last FRAME if (sysread($fh, $buf, 128000, length($buf)) == 0);
				
				## call mad_stream_buffer on the newly created buffer.



( run in 1.019 second using v1.01-cache-2.11-cpan-364913b4093 )