[Ffmpeg-devel] [PATCH] asf seek back at end of file after rewriting header

Rich Felker dalias
Sun Apr 15 19:46:11 CEST 2007


On Sun, Apr 15, 2007 at 07:17:11PM +0200, Baptiste Coudurier wrote:
> Reimar D?ffinger wrote:
> > Hello,
> > On Sun, Apr 15, 2007 at 06:18:06PM +0200, Baptiste Coudurier wrote:
> >> Reimar D?ffinger wrote:
> >>> On Sat, Apr 14, 2007 at 04:13:15AM +0200, Baptiste Coudurier wrote:
> >>> [...]
> >>>> url_fsize does seek.
> >>> Actually that is not completely correct, it tries
> >>> size = s->seek(s->opaque, 0, AVSEEK_SIZE);
> >>> first.
> >>> Even thought that function is called seek, there is no need for this
> >>> operation to seek, and it can be implemented for all kinds of urls,
> >>> whether they are pipes or whatever.
> >> Use f/stat to find file size instead of seek ? Is there any other
> >> solution ? In hope there is no portability problems.
> > 
> > stat only work normal files, what is the point of avoiding the seek with
> > those??
> 
> Yes, there is no point of using f/stat for normal files, that's why
> url_fsize does seek for normal files.

The problem is that seek also works for http and custom stream types,
resulting in horrible performance and abusive behavior. It would be
better to determine the size another way if possible and if not, treat
the size as unknown. Maybe this is already done by AVSEEK_SIZE..?

Rich




More information about the ffmpeg-devel mailing list