diff --git a/subprojects/gst-plugins-good/gst/videofilter/gstvideoflip.c b/subprojects/gst-plugins-good/gst/videofilter/gstvideoflip.c index 5cb7542d43..799513542b 100644 --- a/subprojects/gst-plugins-good/gst/videofilter/gstvideoflip.c +++ b/subprojects/gst-plugins-good/gst/videofilter/gstvideoflip.c @@ -1803,19 +1803,15 @@ 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 */ - 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); + /* Update the orientation tag as we rotate the video accordingly. + * The event (and so the tag list) can be shared so always copy both. */ + taglist = gst_tag_list_copy (taglist); - gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE, - "image-orientation", "rotate-0", NULL); + gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE, + "image-orientation", "rotate-0", NULL); - gst_event_unref (event); - event = gst_event_new_tag (taglist); - } + gst_event_unref (event); + event = gst_event_new_tag (taglist); } } else { // no orientation in tag