[FFmpeg-cvslog] r19646 - trunk/libavcodec/xsubdec.c

Michael Niedermayer michaelni
Sun Aug 16 18:13:00 CEST 2009


On Sat, Aug 15, 2009 at 11:44:07AM +0200, Reimar D?ffinger wrote:
> On Sat, Aug 15, 2009 at 11:18:13AM +0200, Reimar D?ffinger wrote:
> > On Sat, Aug 15, 2009 at 11:12:58AM +0200, reimar wrote:
> > > Author: reimar
> > > Date: Sat Aug 15 11:12:58 2009
> > > New Revision: 19646
> > > 
> > > Log:
> > > Fix start_display_time/end_display_time to be relative to packet pts in xsub decoder.
> > > Makes no difference for the sample AVI files since they all have no packet pts values.
> > 
> > This is actually not working at all anyway, ffplay leaves the AVPacket pts in the stream
> > time_base (which is unknown in the decoder) and ffmpeg does not set it at all.
> 
> Also great fun:
> in ffmpeg.c:do_subtitle_out
>         subtitle_out_size = avcodec_encode_subtitle(enc, subtitle_out,
> 	                                                    subtitle_out_max_size,
> 							    sub);
> ...
>                 pkt.pts += 90 * sub->start_display_time;
> 
> But in avcodec_encode_subtitle:
>    if(sub->start_display_time) {
>            av_log(avctx, AV_LOG_ERROR, "start_display_time must be 0.\n");
>            return -1;
>    }
> 
> If someone can explain to me WTF they thought when coming up with this
> design I might be able to fix it.

the 90 * was probably fabrice being too lazy,busy and sloppy and thinkig
just of mpegs 90khz

the sub->start_display_time == 0 check follows the idea that muxers should
mux packets with correct dts/pts so the muxer can place them in the file
and write indexes and whatever else is needed in a way that they are
returned on demuxing that file at the correct time even in case of seeking
...

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

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- 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-cvslog/attachments/20090816/c7367fbd/attachment.pgp>



More information about the ffmpeg-cvslog mailing list