[Libav-user] Converting audio sample buffer format
nicolas.george at normalesup.org
Tue Feb 26 23:04:59 CET 2013
> On Feb 26, 2013, at 1:01 PM, René J.V. Bertin <rjvbertin-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
> > What I don't dare
> > to guess is why the void* type isn't used - is there a practical reason
> > or only a 'programming principle' behind that?
You can not do pointer arithmetic with void pointers. Therefore, for some
simple task (for example, copying n samples from position m to position p),
having the pointer already with a suitable type avoids an additional cast.
L'octidi 8 ventôse, an CCXXI, Brad O'Hearne a écrit :
> Perhaps I've been staring at this too long and am losing my mind, but
> there is a difference between uint8_t and int8_t:
This difference is irrelevant for pointer arithmetic, it is only relevant
when dereferencing the pointer. You are not supposed to dereference these
pointers directly, you are supposed to cast them to the actual type of the
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: Digital signature
More information about the Libav-user