Re: [MPlayer-dev-eng] [PATCH] ad_spdif.c: Flush output buffer after processing frame, fixes audio stutter
- Date: Sat, 28 Jun 2014 20:22:04 +0200
- From: Reimar Döffinger <Reimar.Doeffinger@xxxxxx>
- Subject: Re: [MPlayer-dev-eng] [PATCH] ad_spdif.c: Flush output buffer after processing frame, fixes audio stutter
On Sat, Jun 28, 2014 at 08:08:37PM +0200, Jan Andres wrote:
> > > The patch adds a call to avio_flush() after passing each audio frame to
> > > lavf to ensure that the write callback is never asked to process more
> > > than one frame's worth of data, which is guaranteed to completely fit
> > > into the output buffer so partial writes do not occur.
> > There is no guarantee this will always work reliably, in the future buffering might be added at even higher layers.
> > I think there is some special flag you are supposed to set to get unbuffered behaviour from lavf.
> Thanks for the pointer, there's an option called "flush_packets" and the
> funny thing is, it's enabled by default. The real issue seems to be that
> ad_spdif.c directly calls the output format's write_packet function
> instead of using av_write_frame(), and doing so, the code that's
> supposed to handle the automatic flushing never gets executed.
This is very confusing (and I posted a few questions on it on the ffmpeg
list), but that was the wrong one.
There is also a flush_packet flag for fflags which maps to
That one flushes automatically, the other one only flushes if you
explicitly send in NULL packets as far as I understand it (which would
possibly be an option as well).
MPlayer-dev-eng mailing list