[FFmpeg-devel] [PATCH] lavfi: add amovie source - audio movie source

Stefano Sabatini stefano.sabatini-lala at poste.it
Tue Aug 23 15:42:37 CEST 2011


On date Monday 2011-08-22 18:48:27 +0200, Michael Niedermayer encoded:
> On Sat, Aug 20, 2011 at 04:09:10PM +0200, Stefano Sabatini wrote:
> > ---
> >  libavfilter/Makefile     |    2 +
> >  libavfilter/allfilters.c |    1 +
> >  libavfilter/movie.c      |  156 ++++++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 159 insertions(+), 0 deletions(-)
> > 
[...]
> > diff --git a/libavfilter/movie.c b/libavfilter/movie.c
> > index f3c11bc..753ed24 100644
> > --- a/libavfilter/movie.c
> > +++ b/libavfilter/movie.c
> > @@ -55,6 +55,13 @@ typedef struct {
> >      /* only video options */
> >      int w, h;
> >      AVFilterBufferRef *picref;
> > +
> > +    /* only audio fields */
> > +    int16_t *samples_buf;
> 
> The type doesnt seem correct as we have decoders that return floats

changed to void *.

[...]
> > +    /* wrap the decoded data in a samplesref */
> > +    if (decoded_data_size > 0) {
> > +        int nb_samples = decoded_data_size / movie->bps / movie->codec_ctx->channels;
> > +        movie->samplesref =
> > +            avfilter_get_audio_buffer(outlink, AV_PERM_WRITE,
> > +                                      movie->codec_ctx->sample_fmt, nb_samples,
> > +                                      movie->codec_ctx->channel_layout, 0);
> > +        memcpy(movie->samplesref->data[0], movie->samples_buf, decoded_data_size);
> 
> the memcpy isnt pretty but probably not worth avoiding

Indeed but left for the moment, can be done in a second moment.

Updated.
-- 
FFmpeg = Friendly and Furious Marvellous Puritan Ecletic Guru
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-lavfi-add-amovie-source-audio-movie-source.patch
Type: text/x-diff
Size: 9303 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110823/2940e68a/attachment.bin>


More information about the ffmpeg-devel mailing list