summaryrefslogtreecommitdiff
path: root/modules/omx
diff options
context:
space:
mode:
authorAlfred E. Heggestad <alfred.heggestad@gmail.com>2018-01-07 11:34:21 +0100
committerAlfred E. Heggestad <alfred.heggestad@gmail.com>2018-01-07 11:34:21 +0100
commit9e7cc48e964ee6a094fe762c31e66bdfc1388ae7 (patch)
tree09af0d6e9971994f5f01e90aa437375a897a4a18 /modules/omx
parent0a6d3066caa52060975537f81a352efe463a807a (diff)
omx: minor fixes
Diffstat (limited to 'modules/omx')
-rw-r--r--modules/omx/omx.c20
-rw-r--r--modules/omx/omx.h4
2 files changed, 15 insertions, 9 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
}
diff --git a/modules/omx/omx.h b/modules/omx/omx.h
index 13d8928..6691d95 100644
--- a/modules/omx/omx.h
+++ b/modules/omx/omx.h
@@ -41,6 +41,6 @@ int omx_display_input_buffer(struct omx_state* st,
void** pbuf, uint32_t* plen);
int omx_display_flush_buffer(struct omx_state* st);
-int omx_display_enable(struct omx_state* st,
+int omx_display_enable(struct omx_state *st,
int width, int height, int stride);
-void omx_display_disable(struct omx_state* st);
+void omx_display_disable(struct omx_state *st);