int time_out;
int compute_edt; /**< if 1 end display time calculated using pts
if 0 (Default) calculated using time out */
+ int compute_clut;
int64_t prev_start;
DVBSubRegion *region_list;
DVBSubCLUT *clut_list;
memcpy(rect->pict.data[0], region->pbuf, region->buf_size);
- if (clut == &default_clut)
+ if ((clut == &default_clut && ctx->compute_clut == -1) || ctx->compute_clut == 1)
compute_default_clut(&rect->pict, rect->w, rect->h);
i++;
int i;
int ret = 0;
int got_segment = 0;
+ int got_dds = 0;
ff_dlog(avctx, "DVB sub packet:\n");
case DVBSUB_DISPLAYDEFINITION_SEGMENT:
ret = dvbsub_parse_display_definition_segment(avctx, p,
segment_length);
+ got_dds = 1;
break;
case DVBSUB_DISPLAY_SEGMENT:
ret = dvbsub_display_end_segment(avctx, p, segment_length, sub, data_size);
+ if (got_segment == 15 && !got_dds && !avctx->width && !avctx->height) {
+ // Default from ETSI EN 300 743 V1.3.1 (7.2.1)
+ avctx->width = 720;
+ avctx->height = 576;
+ }
got_segment |= 16;
break;
default:
#define DS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_SUBTITLE_PARAM
static const AVOption options[] = {
{"compute_edt", "compute end of time using pts or timeout", offsetof(DVBSubContext, compute_edt), FF_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DS},
+ {"compute_clut", "compute clut when not available(-1) or always(1) or never(0)", offsetof(DVBSubContext, compute_clut), FF_OPT_TYPE_INT, {.i64 = -1}, -1, 1, DS},
{NULL}
};
static const AVClass dvbsubdec_class = {