[FFmpeg-devel] [PATCH] flv 32 bit signed timestamps

Michael Niedermayer michaelni
Mon Jul 28 21:46:40 CEST 2008


On Mon, Jul 28, 2008 at 11:42:29AM -0700, Baptiste Coudurier wrote:
> Michael Niedermayer wrote:
> > On Mon, Jul 28, 2008 at 10:17:13AM -0700, Baptiste Coudurier wrote:
> >> Michael Niedermayer wrote:
> >>> On Sun, Jul 27, 2008 at 10:19:17PM -0700, Baptiste Coudurier wrote:
> >>>> Hi,
> >>>>
> >>>> Like figured out, flv uses 32 bit signed timestamps, meaning that
> >>>> pts_wrap_bits must be set to 31.
> >>> What fails, why does it fail and how is it fixed by this change?
> >> Don't remember ? 
> > 
> > i remember signed timestamps, flv, weird dts and pts, but i do not remember
> > how they where connected and how that leads to this patch or what exactly
> > this is supposed to change.
> > 
> > 
> >> Let me restate, FLV specs say timestamps are unsigned,
> >> while flash player use _signed_ 32 bits, this means that max timestamp
> >> value is INT_MAX, if you go > INT_MAX, flash player just interpret
> >> timestamps as 0, which is broken.
> > 
> > timestamps are in ms, to reach INT_MAX needs 3.5 weeks, thats not what you
> > mean i assume ...
> 
> Depends, timestamps are not meant to start at 0, for example, when using
> FFserver, timestamps reflect current time, so timestamps can be >
> INT_MAX, and this is what happens. I guess flash player range value for
> timestamps is 0 - INT_MAX, and for that pts_wrap_bits needs to be set to
> 31 due to truncate_ts.

ok, iam starting to understand things.
would simply changing:
-put_byte(pb,ts >> 24);
+put_byte(pb,(ts >> 24) & 0x7F);

not solve the whole as well? I think that would be simpler

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

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- 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/20080728/1f7f3fb0/attachment.pgp>



More information about the ffmpeg-devel mailing list