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

Michael Niedermayer michaelni at gmx.at
Fri Aug 26 17:05:08 CEST 2011


On Tue, Aug 23, 2011 at 03:42:37PM +0200, Stefano Sabatini wrote:
> 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

>  doc/filters.texi         |   32 +++++++++
>  libavfilter/Makefile     |    2 
>  libavfilter/allfilters.c |    1 
>  libavfilter/src_movie.c  |  157 +++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 192 insertions(+)
> 9ddad86236c915c847542d76a9dcb2f6768af7b1  0004-lavfi-add-amovie-source-audio-movie-source.patch
> From 4b3ee5f7fd181ef6d25bf02cce5b4bc56b995b37 Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> Date: Thu, 18 Aug 2011 14:26:15 +0200
> Subject: [PATCH] lavfi: add amovie source - audio movie source


LGTM if tested

might also be interresting to support reading all video & audio streams
at once

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"
-------------- 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/ffmpeg-devel/attachments/20110826/6705bd62/attachment.asc>


More information about the ffmpeg-devel mailing list