[Libav-user] Converting audio sample buffer format

Nicolas George 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
samples before.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130226/482c1439/attachment.asc>


More information about the Libav-user mailing list