mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
video-overlay-composition: Fix constructor guard to actually allow NULL as parameter
And don't use a NULL rectangle later. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1195>
This commit is contained in:
parent
d495154068
commit
7cb2dff830
1 changed files with 6 additions and 5 deletions
|
@ -344,7 +344,7 @@ gst_video_overlay_composition_new (GstVideoOverlayRectangle * rectangle)
|
||||||
GstVideoOverlayComposition *comp;
|
GstVideoOverlayComposition *comp;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_VIDEO_OVERLAY_RECTANGLE (rectangle)
|
g_return_val_if_fail (GST_IS_VIDEO_OVERLAY_RECTANGLE (rectangle)
|
||||||
|| NULL, NULL);
|
|| rectangle == NULL, NULL);
|
||||||
|
|
||||||
comp = g_slice_new0 (GstVideoOverlayComposition);
|
comp = g_slice_new0 (GstVideoOverlayComposition);
|
||||||
|
|
||||||
|
@ -356,14 +356,15 @@ gst_video_overlay_composition_new (GstVideoOverlayRectangle * rectangle)
|
||||||
comp->rectangles = g_new0 (GstVideoOverlayRectangle *, RECTANGLE_ARRAY_STEP);
|
comp->rectangles = g_new0 (GstVideoOverlayRectangle *, RECTANGLE_ARRAY_STEP);
|
||||||
|
|
||||||
comp->seq_num = gst_video_overlay_get_seqnum ();
|
comp->seq_num = gst_video_overlay_get_seqnum ();
|
||||||
|
comp->min_seq_num_used = comp->seq_num;
|
||||||
/* since the rectangle was created earlier, its seqnum is smaller than ours */
|
|
||||||
comp->min_seq_num_used = rectangle->seq_num;
|
|
||||||
|
|
||||||
GST_LOG ("new composition %p: seq_num %u", comp, comp->seq_num);
|
GST_LOG ("new composition %p: seq_num %u", comp, comp->seq_num);
|
||||||
|
|
||||||
if (rectangle)
|
if (rectangle) {
|
||||||
|
/* since the rectangle was created earlier, its seqnum is smaller than ours */
|
||||||
|
comp->min_seq_num_used = rectangle->seq_num;
|
||||||
gst_video_overlay_composition_add_rectangle (comp, rectangle);
|
gst_video_overlay_composition_add_rectangle (comp, rectangle);
|
||||||
|
}
|
||||||
|
|
||||||
return comp;
|
return comp;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue