On 7/20/13, Massimo Battistel <[email protected]> wrote:
> hello,
> to allocate video frame buffers I use "avpicture_alloc" and to free it I
> use "avpicture_free".
>
> to allocate audio frame buffers I first have to allocate a buffer using
> "av_malloc" and then use "avcodec_fill_audio_frame". Is there a specific
> method to free audio frames? Now I'm using "avpicture_free" and it works,
> but is this the proper way?

You can use av_samples_alloc_array_and_samples() to allocate samples
for specific sample format and av_free(p) to free array and array that holds
pointers to that same array.

Note this is just most elegant why to handle both planar and packed
sample formats: see doc/examples/resampling_audio.c

>
> thanks,
> M
>
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to