summaryrefslogtreecommitdiff
path: root/modules/omx/omx.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/omx/omx.c')
-rw-r--r--modules/omx/omx.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/modules/omx/omx.c b/modules/omx/omx.c
index 6b08d19..13f3207 100644
--- a/modules/omx/omx.c
+++ b/modules/omx/omx.c
@@ -153,8 +153,11 @@ static void block_until_state_changed(OMX_HANDLETYPE hComponent,
}
-void omx_deinit(struct omx_state* st)
+void omx_deinit(struct omx_state *st)
{
+ if (!st)
+ return;
+
info("omx_deinit");
OMX_SendCommand(st->video_render,
OMX_CommandStateSet, OMX_StateIdle, NULL);
@@ -167,13 +170,15 @@ void omx_deinit(struct omx_state* st)
}
-void omx_display_disable(struct omx_state* st)
+void omx_display_disable(struct omx_state *st)
{
- (void)st;
-
- #ifdef RASPBERRY_PI
+#ifdef RASPBERRY_PI
OMX_ERRORTYPE err;
OMX_CONFIG_DISPLAYREGIONTYPE config;
+
+ if (!st)
+ return;
+
memset(&config, 0, sizeof(OMX_CONFIG_DISPLAYREGIONTYPE));
config.nSize = sizeof(OMX_CONFIG_DISPLAYREGIONTYPE);
config.nVersion.nVersion = OMX_VERSION;
@@ -187,8 +192,9 @@ void omx_display_disable(struct omx_state* st)
if (err != 0) {
warning("omx_display_disable command failed");
}
-
- #endif
+#else
+ (void)st;
+#endif
}