[asterisk-dev] RFC: move struct ast_format to include/asterisk/file.h ?

Kevin P. Fleming kpfleming at digium.com
Thu Feb 2 11:18:57 MST 2006

Luigi Rizzo wrote:

> i suppose that if you move data x bytes behind, you do
> 	if (offset < x)
> 		<error, offset too large>
> 	else {
> 		offset -= x;
> 		data -= x;
> 		datalen += x;
> 	}

I believe datalen always reflects the entire buffer size, not just the 
portion from 'data' to the end. Otherwise you are correct.

However, 'data' is rarely changed, since it usually points to the 
beginning of the audio/video samples in the frame. The area before 
'data' is manipulated using temporary pointers and the frame fields are 
not modified.

More information about the asterisk-dev mailing list