mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
videoflip: fix concurrent access when modifying the tag list
We were checking if the tag list is writable, but it may actually be shared through the same event (tee upstream or multiple consumers). Fix a bug where multiple branches have a videoflip element checking the taglist. The first one was changing the orientation back to rotate-0 which was resetting the other instances. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5097>
This commit is contained in:
parent
5114fb4170
commit
6b339b5d39
1 changed files with 7 additions and 11 deletions
|
@ -1803,19 +1803,15 @@ gst_video_flip_sink_event (GstBaseTransform * trans, GstEvent * event)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vf->method == GST_VIDEO_ORIENTATION_AUTO) {
|
if (vf->method == GST_VIDEO_ORIENTATION_AUTO) {
|
||||||
/* update the orientation tag as we rotate the video accordingly */
|
/* Update the orientation tag as we rotate the video accordingly.
|
||||||
if (gst_tag_list_is_writable (taglist)) {
|
* The event (and so the tag list) can be shared so always copy both. */
|
||||||
gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE,
|
taglist = gst_tag_list_copy (taglist);
|
||||||
"image-orientation", "rotate-0", NULL);
|
|
||||||
} else {
|
|
||||||
taglist = gst_tag_list_copy (taglist);
|
|
||||||
|
|
||||||
gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE,
|
gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE,
|
||||||
"image-orientation", "rotate-0", NULL);
|
"image-orientation", "rotate-0", NULL);
|
||||||
|
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
event = gst_event_new_tag (taglist);
|
event = gst_event_new_tag (taglist);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// no orientation in tag
|
// no orientation in tag
|
||||||
|
|
Loading…
Reference in a new issue