Lines Matching defs:sub
157 * @param sub pointer to the processed subtitle data
490 AVSubtitle *sub = data;
496 pts = ctx->presentation.pts != AV_NOPTS_VALUE ? ctx->presentation.pts : sub->pts;
497 memset(sub, 0, sizeof(*sub));
498 sub->pts = pts;
500 sub->start_display_time = 0;
502 // is defined by the start of the next sub which may contain no
503 // objects (i.e. clears the previous sub)
504 sub->end_display_time = UINT32_MAX;
505 sub->format = 0;
510 sub->rects = av_mallocz(sizeof(*sub->rects) * ctx->presentation.object_count);
511 if (!sub->rects) {
519 avsubtitle_free(sub);
525 sub->rects[i] = av_mallocz(sizeof(*sub->rects[0]));
526 if (!sub->rects[i]) {
527 avsubtitle_free(sub);
530 sub->num_rects++;
531 sub->rects[i]->type = SUBTITLE_BITMAP;
540 avsubtitle_free(sub);
547 sub->rects[i]->flags |= AV_SUBTITLE_FLAG_FORCED;
549 sub->rects[i]->x = ctx->presentation.objects[i].x;
550 sub->rects[i]->y = ctx->presentation.objects[i].y;
551 sub->rects[i]->w = object->w;
552 sub->rects[i]->h = object->h;
554 sub->rects[i]->pict.linesize[0] = object->w;
561 avsubtitle_free(sub);
565 ret = decode_rle(avctx, sub->rects[i], object->rle, object->rle_data_len);
569 avsubtitle_free(sub);
572 sub->rects[i]->w = 0;
573 sub->rects[i]->h = 0;
578 sub->rects[i]->nb_colors = 256;
579 sub->rects[i]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
580 if (!sub->rects[i]->pict.data[1]) {
581 avsubtitle_free(sub);
586 memcpy(sub->rects[i]->pict.data[1], palette->clut, sub->rects[i]->nb_colors * sizeof(uint32_t));
603 av_dlog(avctx, "PGS sub packet:\n");