[FFmpeg-devel] [PATCH] lavu/samplefmt: add function av_samples_alloc_pointers()

Paul B Mahol onemda at gmail.com
Tue Jul 9 14:58:05 CEST 2013


On 3/31/13, Stefano Sabatini <stefasab at gmail.com> wrote:
> On date Sunday 2013-03-31 00:25:11 +0100, Michael Niedermayer encoded:
>> On Sat, Mar 30, 2013 at 04:31:08PM +0100, Stefano Sabatini wrote:
> [...]
>> >  doc/APIchanges        |    3 +++
>> >  libavutil/samplefmt.c |   15 +++++++++++++++
>> >  libavutil/samplefmt.h |   13 +++++++++++++
>> >  libavutil/version.h   |    2 +-
>> >  4 files changed, 32 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/doc/APIchanges b/doc/APIchanges
>> > index bc4d4fe..01f7825 100644
>> > --- a/doc/APIchanges
>> > +++ b/doc/APIchanges
>> > @@ -15,6 +15,9 @@ libavutil:     2012-10-22
>> >
>> >  API changes, most recent first:
>> >
>> > +2013-03-30 - xxxxxxx - lavu 52.24.100 - samplefmt.h
>> > +  Add av_samples_alloc_array_and_samples().
>> > +
>> >  2013-03-29 - xxxxxxx - lavf 55.1.100 - avformat.h
>> >    Add av_guess_frame_rate()
>> >
>> > diff --git a/libavutil/samplefmt.c b/libavutil/samplefmt.c
>> > index 6f762df..ecb8274 100644
>> > --- a/libavutil/samplefmt.c
>> > +++ b/libavutil/samplefmt.c
>> > @@ -207,6 +207,21 @@ int av_samples_alloc(uint8_t **audio_data, int
>> > *linesize, int nb_channels,
>> >  #endif
>> >  }
>> >
>> > +int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int
>> > *linesize, int nb_channels,
>> > +                                       int nb_samples, enum
>> > AVSampleFormat sample_fmt, int align)
>> > +{
>> > +    int ret, nb_planes = av_sample_fmt_is_planar(sample_fmt) ?
>> > nb_channels : 1;
>> > +
>> > +    *audio_data = av_malloc(sizeof(*audio_data) * nb_planes);
>>
>> should probably be av_calloc
>
> Yes.
>
>> otherwise LGTM
>
> Pushed with that change, thanks.
> --
> FFmpeg = Free & Fantastic MultiPurpose Enhancing Gospel
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

What is point of this if not used by anything?


More information about the ffmpeg-devel mailing list