[FFmpeg-devel] [PATCH] Increase ffplay buffer size

Michael Niedermayer michaelni
Wed Oct 21 14:08:59 CEST 2009


On Wed, Oct 21, 2009 at 02:06:00AM +0200, Marton Balint wrote:
> Hi,
>
> I have recently come across a 1080i DVB-C mpeg TS stream where I 
> experienced sound buffer underruns, because the audio queue has become 
> empty from time to time.
>
> The cause of this was the too small video queue size, because ffplay 
> stopped reading packets when the video queue was full, even if the audio 
> queue only contained 1 or 2 KB of data.
>
> My patch solves this problem by increasing the buffers to 10 times of their 
> original size, and also adds an extra check, to stop reading packets if all 
> of the buffers are more than 5% full.

your patch might be ok for files stored on disk given the disk is fast.
Correctly though would it be to make the buffers sized depending on
the vbv buffer size (AVCodecContext.rc_buffer_size if the decoders or
parsers are changed to set that)
and where rc_buffer_size is not known some constant or value depending
on the bitrate could be used. (similar to how its done currently)

also the clock reference has to be synchronized to the pcr values from
mpeg (its a seperate issue bit also mandatory if you want to keep buffers
from over or underflowing)


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

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091021/e23259d2/attachment.pgp>



More information about the ffmpeg-devel mailing list