[FFmpeg-devel] [PATCH] examples: add resampling_audio.c file

Stefano Sabatini stefasab at gmail.com
Tue Dec 4 22:55:24 CET 2012


On date Tuesday 2012-12-04 18:14:53 +0100, Michael Niedermayer encoded:
> On Tue, Dec 04, 2012 at 10:58:48AM +0100, Stefano Sabatini wrote:
[...]
> > > > And I'm not sure why swr_get_delay() is useful/required.
> > > 
> > > If you ever feed "more" in than take out then these samples get
> > > buffered. Such samples would be stuck in there until flushing
> > > at the end without the swr_get_delay().
> > 
> > I realized that the swr_get_delay() in the example is useless, since it
> > is called before the first conversion is performed (so it is always
> > 0). On the other hand the destination size is computed so that it
> > should contain *all* the converted samples, so I assume that if the
> > output buffer is big enough then no buffering will occurr at all.  Is
> > this correct?
> 
> resampling needs a delay and this delay may vary slightly due filter
> parameters and timestamp drift.
> this variation may occasionally cause a tiny bit more samples to be
> available than the rounded up value.

Updated.
-- 
FFmpeg = Frenzy and Faithless Mastodontic Peaceless Enlightened Gigant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-examples-add-resampling_audio.c-file.patch
Type: text/x-diff
Size: 9698 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121204/69abe0c8/attachment.bin>


More information about the ffmpeg-devel mailing list