[FFmpeg-devel] [PATCH] avfilter/af_asetnsamples: fix sample queuing.

Michael Niedermayer michael at niedermayer.cc
Sun Apr 7 17:06:21 EEST 2019


On Sat, Apr 06, 2019 at 09:47:07AM +0200, Paul B Mahol wrote:
> On 4/6/19, Nikolas Bowe via ffmpeg-devel <ffmpeg-devel at ffmpeg.org> wrote:
> > When asetnsamples uses output samples < input samples, remaining samples
> > build up in the fifo over time.
> > Fix this by marking the filter as ready again if there are enough samples.
> >
> > Regression since ef3babb2c70f564dc1634b3f29c6e35a2b2dc239
> > ---
> >  libavfilter/af_asetnsamples.c | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavfilter/af_asetnsamples.c b/libavfilter/af_asetnsamples.c
> > index c60ce3063f..cab02d56f6 100644
> > --- a/libavfilter/af_asetnsamples.c
> > +++ b/libavfilter/af_asetnsamples.c
> > @@ -67,8 +67,12 @@ static int activate(AVFilterContext *ctx)
> >          return ret;
> >
> >      if (ret > 0) {
> > -        if ((!s->pad || (s->pad && frame->nb_samples ==
> > s->nb_out_samples)))
> > -            return ff_filter_frame(outlink, frame);
> > +        if ((!s->pad || (s->pad && frame->nb_samples ==
> > s->nb_out_samples))) {
> > +            ret = ff_filter_frame(outlink, frame);
> > +            if (ff_framequeue_queued_samples(inlink) >= s->nb_out_samples)
> > +                ff_filter_set_ready(ctx, 100);
> > +            return ret;
> > +        }
> >
> >          pad_frame = ff_get_audio_buffer(outlink, s->nb_out_samples);
> >          if (!pad_frame) {
> > --
> > 2.21.0.392.gf8f6787159e-goog
> >
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
> 
> ok

will apply

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Modern terrorism, a quick summary: Need oil, start war with country that
has oil, kill hundread thousand in war. Let country fall into chaos,
be surprised about raise of fundamantalists. Drop more bombs, kill more
people, be surprised about them taking revenge and drop even more bombs
and strip your own citizens of their rights and freedoms. to be continued
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190407/fc414a2c/attachment.sig>


More information about the ffmpeg-devel mailing list