[MPlayer-dev-eng] NUT cleanup
Michael Niedermayer
michaelni at gmx.at
Tue Sep 6 21:27:55 CEST 2005
Hi
On Tue, Sep 06, 2005 at 09:41:44PM +0300, Oded Shimon wrote:
> On Tue, Sep 06, 2005 at 07:05:19PM +0200, Michael Niedermayer wrote:
> > Hi
> >
> > On Tue, Sep 06, 2005 at 07:41:56PM +0300, Oded Shimon wrote:
> > [...]
> > > > [...]
> > > >
> > > > > @@ -292,6 +301,8 @@
> > > > > 0xDD672F23E64EULL + (((uint64_t)('N'<<8) + 'X')<<48)
> > > > > info_startcode
> > > > > 0xAB68B596BA78ULL + (((uint64_t)('N'<<8) + 'I')<<48)
> > > > > +end_startcode
> > > > > + 0xE8154EDB2A7CULL + (((uint64_t)('N'<<8) + 'E')<<48)
> > > >
> > > > what is the end_startcode good for? i dont remember any arguments against
> > > > simply storing a 64bit index_ptr at the end except its "bleh" which well
> > > > i dont really care about, i prefer a nut spec which is bleh over one which
> > > > is complicated and bloated
> > > > btw, FAQ:
> > > > Q: why didnt you just store a 64bit int at the end?
> > > > A: because its bleh
> > > > Q2: but dont u see that now we have to search backward for that startcode,
> > > > then parse th vlc forward, keep track of where the vlc started and subtract
> > > > its value from that to find the index?
> > > > A2: ?
> > >
> > > No, It's a bigger problem - I realized, if you just put a 64bit int at the
> > > end, how the hell do you know if you have the end or not? Say I have an
> > > incomplete file, The end data could be any random junk, and i'd have no way
> > > of knowing if i really have the entire file or not!
> >
> > 1. check if the 64bit ptr points within the file (check needed no matter how
> > its stored anyway)
> > 2. seek there and check if the index_startcode is there (again we need to
> > check this for all variants anyway)
> > -> so IMHO the 64bit variant is much simpler
>
> Wait, I still want an end_startcode - to know i've reached EOF if there is
> no index... Basically without it you just have 8 last bytes appearing to
> you pretending to be a frame...
hmm, dont store anything, not even the 64bit zero pointer if there is no index,
that way you could even append something afterwards
or alternatively, well why not always store a index, it would be more
consistant too if valid nut files would always have an index, hmm somehow
i think ill be flamed soon for the later suggestion :)
[...]
--
Michael
More information about the MPlayer-dev-eng
mailing list