[FFmpeg-devel] qt-faststart refactor exit code

Frank Barchard fbarchard
Tue Jun 30 01:23:20 CEST 2009


On Mon, Jun 29, 2009 at 3:24 PM, Diego Biurrun <diego at biurrun.de> wrote:

> On Mon, Jun 29, 2009 at 03:15:45PM -0700, Frank Barchard wrote:
> > On Mon, Jun 29, 2009 at 2:52 PM, Diego Biurrun <diego at biurrun.de> wrote:
> >
> > > On Mon, Jun 29, 2009 at 01:51:03PM -0700, Frank Barchard wrote:
> > > >
> > > > Also note theres a minor bug with the existing code using %llx.
> > > > I deferred fixing it, as y'all seem to prefer separate submissions
> > > > for each fix.
> > >
> > > Sounds like something I could apply right away...
> >
> > okay, I'm getting faster at these diffs.  The old code used %llX, which
> > doesnt work properly on MinGW.  It also assumes long long is int64, which
> > isn't guaranteed on all future compilers.  Standard GCC C99 inttypes.h
> > provides
> > #define PRIX64 "llX"
> > and maps to MinGW
> > #define PRIX64 "I64X"
> >
> > Only 2 lines are affected, so heres the change:
> >
> > --- tools/qt-faststart.orig.c   2009-05-07 21:41:30.000000000 -0700
> > +++ tools/qt-faststart.llx.c    2009-06-29 15:11:42.968285000 -0700
>
> That does not apply cleanly at all.  Also, your patch is mangled.


Sorry about the newbie mistakes.  I was diff-ing from a git branch.
This time I did this
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg_mainline
svn diff -x -w tools/qt-faststart.c >faststart.diff
and tested by doing this
patch -p0 <faststart.diff


>
>
> > @@ -170,7 +170,7 @@ int main(int argc, char *argv[])
> >      moov_atom_size = atom_size;
> >      moov_atom = malloc(moov_atom_size);
> >      if (!moov_atom) {
> > -        printf ("could not allocate 0x%llX byte for moov atom\n",
> > +        printf ("could not allocate 0x" PRIX64 "X byte for moov atom\n",
>
> This is not correct, the '%' is gone..
>

doh!  Fixed.  Hard to test, since it only happens errors.   I tried it with
a 4 compilers and ran it, but the error doesnt normally come up.  By forcing
malloc to fail I confirmed the printf with PRIX64 works:
qt-faststart.exe bali.mov bob.mov
could not allocate 0x18 byte for ftyp atom
qt-faststart.exe bali.mov bob.mov
could not allocate 0x201AB byte for moov atom

fixed up diff attached



>
> > >
> > > Diego
> > > _______________________________________________
> > > ffmpeg-devel mailing list
> > > ffmpeg-devel at mplayerhq.hu
> > > https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
> > >
>
> Please remove quoted text you do not reply to, thanks.
>
> Diego
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qt-faststart.diff
Type: application/octet-stream
Size: 899 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090629/1ba23f65/attachment.obj>



More information about the ffmpeg-devel mailing list