Skip to content

Commit 8c98ce1

Browse files
committed
Fix alpha is lost from embedded xml clip
As reported here: https://forum.shotcut.org/t/embedded-mlt-file-loses-transparent-background/50441 For YUV formats, the alpha buffer was not being passed through the xml clip Also, color properties were not being passed - causing wrong colors when using linear transfer characteristics.
1 parent 342e79f commit 8c98ce1

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/modules/xml/producer_xml-clip.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,20 @@ static int producer_get_image(mlt_frame frame,
8989
return error;
9090
}
9191
mlt_frame_set_image(frame, *image, 0, NULL);
92+
93+
int size;
94+
uint8_t *data = mlt_frame_get_alpha_size(xml_frame, &size);
95+
if (data) {
96+
mlt_frame_set_alpha(frame, data, size, NULL);
97+
}
98+
9299
mlt_properties_set_int(frame_properties, "format", *format);
93100
mlt_properties_set_int(frame_properties, "width", *width);
94101
mlt_properties_set_int(frame_properties, "height", *height);
95-
mlt_properties_pass_list(frame_properties,
96-
xml_frame_properties,
97-
"colorspace aspect_ratio progressive");
102+
mlt_properties_pass_list(
103+
frame_properties,
104+
xml_frame_properties,
105+
"colorspace aspect_ratio progressive full_range top_field_first color_trc color_primaries");
98106

99107
return error;
100108
}

0 commit comments

Comments
 (0)