[Libav-user] Question on implementing a custom IO callback in ByteIOContext.

Dongwon Kang dwkang at camars.kaist.ac.kr
Wed Sep 7 07:27:30 CEST 2011

Hi all,

I am trying to implement custom IO call backs by using ByteIOContext in
avio.h in order to support http sources.
The implementation of the most callbacks were pretty much straight forward,
but I faced a problem while handling seek() operation with SEEK_END flag.
The problem is that there are some cases that we don't know the actual size
of the source. (e.g. http source which chunked transfer

Regarding the callback for seek operation, I found some article which says:
"int64_t SeekFunc(void *opaque, int64_t
int whence) ;
you must return the current position of your stream  in bytes (that is,
after the seeking is performed). If the seek has failed you must return <0."

So, my question is:
1. Will it be okay to return -1 if we don't know the actual size of the
2. If so, will the ffmpeg demux code just fail to demux the source or treat
it as streaming source and continue parsing?

Any comments are welcome!
Dongwon Kang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20110907/32d3eed9/attachment.html>

More information about the Libav-user mailing list