[FFmpeg-devel] [PATCH 11/11] RealText demuxer and decoder.

Philip Langdale philipl at overt.org
Thu Jun 28 05:41:46 CEST 2012


On Fri, 22 Jun 2012 22:44:06 +0200
Clément Bœsch <ubitux at gmail.com> wrote:

> +
> +static int realtext_decode_frame(AVCodecContext *avctx,
> +                                 void *data, int *got_sub_ptr,
> AVPacket *avpkt) +{
> +    AVSubtitle *sub = data;
> +    const char *ptr = avpkt->data;
> +    AVBPrint buf;
> +
> +    av_bprint_init(&buf, 0, 4096);
> +    if (ptr && avpkt->size > 0 && !rt_event_to_ass(&buf, ptr))
> +        ff_ass_add_rect(sub, buf.str, avpkt->pts, avpkt->duration,
> 0);
> +    *got_sub_ptr = sub->num_rects > 0;
> +    av_bprint_finalize(&buf, NULL);
> +    return avpkt->size;
> +}
> +

(I replied about this before, but I guess it slipped by.

Don't you need to rescale pts and duration?

Otherwise it looks fine.

--phil


More information about the ffmpeg-devel mailing list