Skip to content

Commit 16f05cf

Browse files
committed
Unref videoflip before creating a new one.
1 parent 0d24acd commit 16f05cf

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

extensions/gstreamer_tools/gth-media-viewer-page.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1374,14 +1374,23 @@ _gth_media_viewer_page_set_uri (GthMediaViewerPage *self,
13741374
const char *uri,
13751375
GstState state)
13761376
{
1377+
GstElement *videoflip;
1378+
13771379
g_return_if_fail (self->priv->playbin != NULL);
13781380

13791381
gst_element_set_state (self->priv->playbin, GST_STATE_NULL);
13801382

13811383
/* Re-create videoflip every time because the auto-mode will remember
13821384
the last-seen orientation tag and will happily use it for a new
13831385
file that does not contain any orientation tag. */
1384-
GstElement *videoflip = gst_element_factory_make ("videoflip", "");
1386+
1387+
g_object_get (self->priv->playbin, "video-filter", &videoflip, NULL);
1388+
if (videoflip != NULL) {
1389+
gst_object_unref (GST_OBJECT (videoflip));
1390+
videoflip = NULL;
1391+
}
1392+
1393+
videoflip = gst_element_factory_make ("videoflip", "");
13851394
g_object_set (videoflip, "video-direction", GST_VIDEO_ORIENTATION_AUTO, NULL);
13861395
g_object_set (self->priv->playbin, "video-filter", videoflip, NULL);
13871396

0 commit comments

Comments
 (0)