[FFmpeg-devel] [RFC] Seeking in PVA files

Ivo ivop
Sat Jan 5 18:04:09 CET 2008


On Saturday 05 January 2008 11:46, Ivo wrote:
> On Saturday 05 January 2008 02:13, Michael Niedermayer wrote:
> > On Fri, Jan 04, 2008 at 12:52:19PM +0100, Ivo wrote:
> > > +static inline int64_t get_pes_pts(int pes_flags, uint8_t
> > > *pes_header_data) { +    int64_t res = AV_NOPTS_VALUE;
> > > +
> > > +    if (pes_flags & 0x80 && (pes_header_data[0] & 0xf0) == 0x20) {
> > > +        res  = ((long long) *pes_header_data & 0x0e) << 29;
> > > +        res += (AV_RB16(pes_header_data+1) >> 1) << 15;
> > > +        res +=  AV_RB16(pes_header_data+3) >> 1;
> > > +    }
> > > +
> > > +    return res;
> > > +}
> >
> > duplicate of get_pts() from mpeg.c
> > and i suspect this is not the only one
>
> Yes, though they are not 100% identical as get_pts() from mpeg.c reads
> from a ByteIOContext and this one does not. But I'll see if I can find a
> way to merge the code.

How about the attached patch? This way I can easily call ff_parse_pes_pts() 
from pva.c and from other demuxers that encapsulate MPEG-PES streams.

--Ivo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_mpeg_pes_pts
Type: text/x-diff
Size: 1229 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080105/78639676/attachment.diff>



More information about the ffmpeg-devel mailing list