[FFmpeg-devel] [RFC] Seeking in PVA files
Ivo
ivop
Sun Jan 6 21:29:56 CET 2008
On Sunday 06 January 2008 19:50, M?ns Rullg?rd wrote:
> Ivo <ivop at euronet.nl> writes:
> > Index: libavformat/mpeg.c
> > ===================================================================
> > --- libavformat/mpeg.c (revision 11412)
> > +++ libavformat/mpeg.c (working copy)
> > @@ -120,17 +120,12 @@
> >
> > static int64_t get_pts(ByteIOContext *pb, int c)
> > {
> > - int64_t pts;
> > - int val;
> > + uint8_t buf[5];
> >
> > - if (c < 0)
> > - c = get_byte(pb);
> > - pts = (int64_t)(c & 0x0e) << 29;
> > - val = get_be16(pb);
> > - pts |= (int64_t)(val >> 1) << 15;
> > - val = get_be16(pb);
> > - pts |= (int64_t)(val >> 1);
> > - return pts;
> > + buf[0] = c<0 ? get_byte(pb) : c;
> > + AV_WB32(buf+1, get_be32(pb));
>
> Why not use get_buffer()?
+ buf[0] = c<0 ? get_byte(pb) : c;
+ get_buffer(pb, buf+1, 4);
Would that be ok?
--Ivo
More information about the ffmpeg-devel
mailing list