glimagesink: balance change_state display ref/unref
authorMatthew Waters <matthew@centricular.com>
Fri, 24 Apr 2015 07:13:10 +0000 (17:13 +1000)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:59 +0000 (19:31 +0000)
the display was being unreffed on the incorrect state change causing
invalid state when changing from PLAYING/PAUSED->READY->PAUSED/PLAYING.

ext/gl/gstglimagesink.c

index 1047616..796392d 100644 (file)
@@ -968,15 +968,14 @@ gst_glimage_sink_change_state (GstElement * element, GstStateChange transition)
         gst_object_unref (glimage_sink->context);
         glimage_sink->context = NULL;
       }
-
+      break;
+    }
+    case GST_STATE_CHANGE_READY_TO_NULL:
       if (glimage_sink->display) {
         gst_object_unref (glimage_sink->display);
         glimage_sink->display = NULL;
       }
       break;
-    }
-    case GST_STATE_CHANGE_READY_TO_NULL:
-      break;
     default:
       break;
   }