[FFmpeg-devel] [PATCH] timestamp discontinuity in subtitles is OK

Michael Niedermayer michaelni
Sun Oct 5 18:35:08 CEST 2008

On Sun, Oct 05, 2008 at 12:36:23PM -0000, Wolfram Gloger wrote:
> > Date: Sun, 5 Oct 2008 02:27:48 +0200
> > From: Michael Niedermayer <michaelni at gmx.at>
> > On Sun, Oct 05, 2008 at 02:17:19AM +0200, Michael Niedermayer wrote:
> > > On Sun, Oct 05, 2008 at 01:38:01AM +0200, Aurelien Jacobs wrote:
> > > > Hi,
> > > >=20
> > > > ffmpeg.c contains some code to fix pts/dts when detecting timestamp
> > > > discontinuity. This is nice, but it really shouldn't care about
> > > > discontinuity in subtitle tracks, for obvious reason.
> > > > Attached patch disable discontinuity detection for subtitle tracks.
> > >=20
> > > rejected
> To also elaborate, I had proposed the _exact same_ patch as Aurelien
> in issue 356 in February.  Please see the discussion there.
> > to elaborate before someone asks
> > 
> > subtitles have AVPacket.duration=3D0 that means unknown duration
> > and the discontinuity detection should test
> > last packet time + last packet duration vs. current paket time
> > thus if any of the 3 is unknown then the discontinuity detection
> > shouldnt even run.
> Ah, progress!  What about the appended patch then, which does exactly
> this.  Aurelien, does this work for you?
> Yes, this patch means _more_ special casing, but as a followup patch,
> the code dealing with next_pts could be completely factored out of the
> "switch(ist->st->codec->codec_type)", assuming that pkt->duration is
> set correctly also for the audio and video case (this would have to be
> tested first, which I haven't yet done).

carefull, you are missing a few issues here

the first being b frame reordering (if the code is used for video)
second being that this isnt strictly correct nor what i suggested,
its not making the discontinuity code check the last duration it
changes next_pts which really is used for more than discontinuity
third, while AVPacket == decoder packet whenever possible this is not
always possible, when its not next_pts is the variable that keeps track
of the next pts and this is needed even when duration==0


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- 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/20081005/efeea8b9/attachment.pgp>

More information about the ffmpeg-devel mailing list