- if (ptr && avpkt->size > 0 && !webvtt_event_to_ass(&buf, ptr)) {
- int ts_start = av_rescale_q(avpkt->pts, avctx->time_base, (AVRational){1,100});
- int ts_duration = avpkt->duration != -1 ?
- av_rescale_q(avpkt->duration, avctx->time_base, (AVRational){1,100}) : -1;
- ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_duration);
- }
+ if (ptr && avpkt->size > 0 && !webvtt_event_to_ass(&buf, ptr))
+ ret = ff_ass_add_rect(sub, buf.str, s->readorder++, 0, NULL, NULL);