qt: use a static_cast instead of dynamic one

The dynamic_cast is a little but of overkill as the app will still crash if it
fails in the later g_assert.

Allows compilation with -fno-rtti

https://bugzilla.gnome.org/show_bug.cgi?id=762526
This commit is contained in:
Matthew Waters 2016-02-23 23:10:20 +11:00
parent 472b396528
commit 6c6a9cf509
2 changed files with 2 additions and 2 deletions

View file

@ -305,7 +305,7 @@ gst_qt_sink_change_state (GstElement * element, GstStateChange transition)
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
app = dynamic_cast<QGuiApplication *> (QCoreApplication::instance ());
app = static_cast<QGuiApplication *> (QCoreApplication::instance ());
if (!app) {
GST_ELEMENT_ERROR (element, RESOURCE, NOT_FOUND,
("%s", "Failed to connect to Qt"),

View file

@ -122,7 +122,7 @@ void InitializeSceneGraph::run()
QtGLVideoItem::QtGLVideoItem()
{
QGuiApplication *app = dynamic_cast<QGuiApplication *> (QCoreApplication::instance ());
QGuiApplication *app = static_cast<QGuiApplication *> (QCoreApplication::instance ());
static volatile gsize _debug;
g_assert (app != NULL);