[Libav-user] av_samples_fill_arrays and memory

Alex Cohn alexcohn at netvision.net.il
Fri Apr 26 21:56:35 CEST 2013


On Fri, Apr 26, 2013 at 10:47 PM, Paul B Mahol <onemda at gmail.com> wrote:
>
> > But what if the above was done, yet this was also true:
> >
> > audio_data[1] != (audio_data[0] + line_size)
> >
> > The audio_data array has proper pointers to each channel -- and each channel
> > may be properly aligned within. But what if multiple channels aren't in
> > contiguous memory? Is that going to be an issue in using the audio_data
> > array at any point, perhaps later in encoding?
> >
> > I think this what may be what Alex was alluding to in a previous post.
>
> Contiguous memory or not AFAIK should not matter.

... but attempt to use a contiguous buffer when the data is not
aligned correctly inside it, does matter, I believe.

> Instead of setting pointers, you could memcpy data instead, and if
> done correctly your issue should be solved.

That's a precise prescription.

Alex


More information about the Libav-user mailing list