From 4c77bc21617d3717bcd677d1fd3dce71713edb2b Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 7 Jul 2023 12:33:37 +0200 Subject: [PATCH] videoflip: fix critical when tag list is not writable Fix this pipeline where the tag list is not writable: gst-launch-1.0 videotestsrc ! taginject tags="image-orientation=rotate-90" ! videoflip video-direction=auto \ ! autovideosink GStreamer-CRITICAL **: 12:34:36.310: gst_tag_list_add: assertion 'gst_tag_list_is_writable (list)' failed Part-of: --- .../gst-plugins-good/gst/videofilter/gstvideoflip.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-good/gst/videofilter/gstvideoflip.c b/subprojects/gst-plugins-good/gst/videofilter/gstvideoflip.c index 003a79e..bd7cbeb 100644 --- a/subprojects/gst-plugins-good/gst/videofilter/gstvideoflip.c +++ b/subprojects/gst-plugins-good/gst/videofilter/gstvideoflip.c @@ -1791,8 +1791,18 @@ gst_video_flip_sink_event (GstBaseTransform * trans, GstEvent * event) if (vf->method == GST_VIDEO_ORIENTATION_AUTO) { /* update the orientation tag as we rotate the video accordingly */ - gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE, "image-orientation", - "rotate-0", NULL); + if (gst_tag_list_is_writable (taglist)) { + gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE, + "image-orientation", "rotate-0", NULL); + } else { + taglist = gst_tag_list_copy (taglist); + + gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE, + "image-orientation", "rotate-0", NULL); + + gst_event_unref (event); + event = gst_event_new_tag (taglist); + } } } break; -- 2.7.4