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

Michael Niedermayer michaelni
Sat Apr 14 10:53:15 CEST 2007


Hi

On Sat, Apr 14, 2007 at 04:13:15AM +0200, Baptiste Coudurier wrote:
> M?ns Rullg?rd wrote:
> > Baptiste Coudurier <baptiste.coudurier at smartjog.com> writes:
> > 
> >> Michael Niedermayer wrote:
> >>> Hi
> >>>
> >>> On Sat, Apr 14, 2007 at 12:20:44AM +0200, Baptiste Coudurier wrote:
> >>>> Michael Niedermayer wrote:
> >>>>> Hi
> >>>>>
> >>>>> On Fri, Apr 13, 2007 at 11:52:41PM +0200, Baptiste Coudurier wrote:
> >>>>>> Hi
> >>>>>>
> >>>>>> $subj.
> >>>>> Why?
> >>>> Because without that, url_ftell will not report file size,
> >>> you mean url_ftell() will not return file size after muxing an asf file has
> >>> finished
> >>>
> >>> but why should url_ftell() behave like that?!
> >> Why should stream position after write_trailer be at any random location?
> > 
> > The file shouldn't be accessed after this, so the location shouldn't
> > matter.  Now it seems ffmpeg.c assumes that the file position will
> > always be at the end.  Rather than requiring every muxer to ensure
> > this, I agree that it's better to do things properly in ffmpeg.c.
> 
> I think differently, IMHO expecting that after write_trailer,
> ByteIOContext is at the end of the file does not seem weird,
> and if file should not be accessed after write_trailer, how should you
> know how big the file is ? f/stat ? url_fsize ? url_fsize does seek.

if(url_is_streamed()) size= url_ftell()
else                  size= url_fsize()

might work ...

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

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070414/b0cc8130/attachment.pgp>



More information about the ffmpeg-devel mailing list