[Ffmpeg-devel] Re: [PATCH] file length handling

Ronald S. Bultje rbultje
Sun Dec 31 21:25:51 CET 2006


Hi Michael,

On Fri, 2006-12-29, Michael Niedermayer wrote:
> On Wed, Dec 27, 2006 at 08:11:39PM -0500, Ronald S. Bultje wrote:
> > I don't mind if file_size is not available for a while (until whenever
> > is the next time that ABI is broken) on such streams, but it should be,
> > eventually. Adding file_size really is the right thing to do, imo.
> 
> if the patch which adds file_size + a function pointer for ByteIOContext
> is small then ive no objections if its large i do have objections ...

OK, I've attached a patch below which does just that.

As for the small second patch, I noticed misbehaviour in url_fseek()
when seeking fails. The return value of the seek function in my http.
seek implementation and from lseek() in file.c (only protocol
implementing seek so far) is -1 on error, not -EPIPE (the return value
in url_seek() if no seek function pointer is set), hence the bugfix.
Should be a no-brainer.

The other patch simply adds file_size to URLContext, reads it in
url_filesize() and sets a default. Same for ByteIOContext and the
get_length() function pointer, plus the implementation. I hope this is
small+simple enough to be acceptable. In addition to this, return values
from url_filesize() for protocols that do not implement seeking or on
files which are unseekable (e.g. fifos) should be consistently -1 now,
whereas previously, they could be any negative number or even 0.

Once those are in, I'll send a new patch with my http seeking
implementation (including fixes suggested earlier on). I'll send a
cleanup patch for all this once ABI has been broken and the #ifdefs are
no longer needed.

Cheers,
Ronald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1
Type: text/x-patch
Size: 4066 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20061231/ea42d602/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2
Type: text/x-patch
Size: 893 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20061231/ea42d602/attachment-0001.bin>



More information about the ffmpeg-devel mailing list