[FFmpeg-devel] [PATCH] HLS problem

Martin Storsjö martin
Thu Jan 13 07:30:59 CET 2011

On Wed, 12 Jan 2011, Reimar D?ffinger wrote:

> On Wed, Jan 12, 2011 at 06:57:07PM +0100, Michael Niedermayer wrote:
> > 
> > About ByteIOContext, which part does not handle incomplete reads?
> Hm, looks like I vastly overestimated the issue, in which case I agree
> above patch is not acceptable.
> I haven't tested it, but I suspect that get_buffer and fill_buffer both
> need to handle EAGAIN.
> I don't fully understand that though, since that really should lead to EOF instead
> of constant decode errors...

Exactly, if that's the issue, it would be much more visible.

One wild guess on what's wrong is the mpegts demuxer trying to do a bit of 
backwards seeks. If filling all of the ByteIOContext buffer with 
url_read_complete, these backwards seeks probably work better than if we 
only buffer as much data at a time as the lower protocol function returns.

I'm not sure of all the details in fill_buffer, but it looks like it quite 
often could throw away the previously buffered data (e.g. if we have a 32k 
buffer, but only get 1k returned by url_read at a time, and we throw away 
the previously read 1k in hoping of getting a full buffer in the next 

// Martin

More information about the ffmpeg-devel mailing list