dvbsuboverlay: Add support for dynamic resolution update.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1487

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1897>
This commit is contained in:
Raju Babannavar 2020-12-21 14:06:53 +05:30
parent 0840477b81
commit 7e7e54d089

View file

@ -1139,6 +1139,7 @@ _dvb_sub_parse_display_definition_segment (DvbSub * dvb_sub, guint8 * buf,
gint buf_size)
{
int dds_version, info_byte;
int display_width, display_height;
if (buf_size < 5)
return -1;
@ -1146,14 +1147,23 @@ _dvb_sub_parse_display_definition_segment (DvbSub * dvb_sub, guint8 * buf,
info_byte = *buf++;
dds_version = info_byte >> 4;
display_width = GST_READ_UINT16_BE (buf) + 1;
buf += 2;
display_height = GST_READ_UINT16_BE (buf) + 1;
buf += 2;
if ((display_width != dvb_sub->display_def.display_width)
|| (display_height != dvb_sub->display_def.display_height)) {
dvb_sub->display_def.display_width = display_width;
dvb_sub->display_def.display_height = display_height;
dvb_sub->display_def.version = -1;
}
if (dvb_sub->display_def.version == dds_version)
return 0; /* already have this display definition version */
dvb_sub->display_def.version = dds_version;
dvb_sub->display_def.display_width = GST_READ_UINT16_BE (buf) + 1;
buf += 2;
dvb_sub->display_def.display_height = GST_READ_UINT16_BE (buf) + 1;
buf += 2;
dvb_sub->display_def.window_flag = info_byte & 1 << 3;