[FFmpeg-devel] ARMovie/RPL demuxer

Michael Niedermayer michaelni
Mon Mar 24 11:34:42 CET 2008


On Sun, Mar 23, 2008 at 07:35:28PM -0700, Eli Friedman wrote:
> On Sun, Mar 23, 2008 at 4:02 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> >  floats are not accurate things, this makes regression tests hard.
> >  The string should be parsed into a AVRational with no intermediate
> >  float/double.
> 
> Is there some existing method to parse stuff like 25.000 directly into
> an AVRational?  I can't seem to find one.  (I can put something
> together if there isn't, though.)

parse the number before and after the decimal point as int and use
av_reduce() to get a proper fraction.


> 
> >  > +        // There should always be frames_per_chunk frames in a chunk.
> >  > +        // (This should be checked once video decoding is implemented.)
> >  > +        pkt->duration = rpl->frames_per_chunk;
> >
> >  1 AVPacket == 1 frame. Either demuxer or parser has to split them if there
> >  are more.
> 
> Mmm.  The only known Escape 122 sample happens to have one frame per
> chunk, so it's not an issue there.
> 

> For Escape 124, this gets to be a bit tricky because the demuxer has
> to actually read first 8 bytes of the frame to figure out its size,
> and this includes some flags that the decoder needs.  I guess in that
> case, I can seek backwards and afterwards so that data ends up in the
> packet.  Or is there some other preferred way to do this?

you could read the whole in one avpacket, do with the 8 bytes what you need
and just change avpacket->size and copy half of the data in a second
avpacket. 
Or just seek back if you prefer ...

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

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080324/15219d6c/attachment.pgp>



More information about the ffmpeg-devel mailing list