[FFmpeg-devel] [PATCH 2/2] lavc/srtdec: set subtitle timing in the structure.

Nicolas George nicolas.george at normalesup.org
Tue Sep 11 21:14:27 CEST 2012

Le sextidi 26 fructidor, an CCXX, Clément Bœsch a écrit :
> >          ff_ass_add_rect(sub, buffer, ts_start / 10, ts_end / 10 - ts_start / 10, 0);
> > +        sub->start_display_time = ts_start - ts_packet;
> > +        sub->end_display_time   = ts_end   - ts_packet;
> Is this really necessary? What does it fix?

ff_ass_add_rect updates end_display_time, but does it with centisecond
accuracy. With some srt files, it causes millisecond changes for a
decode-encode round trip.

Ultimately, I believe we should get rid of ff_ass_add_rect and let
avcodec_decode_subtitle2 init end_display_time using the packet duration,
but until we have a clean design I would rather make only minimal changes to
fix bugs, and setting end_display_time here is just that.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120911/5ecb3a53/attachment.asc>

More information about the ffmpeg-devel mailing list