summaryrefslogtreecommitdiff
path: root/libavcodec/omx.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-02 16:45:16 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-04 08:04:22 +0200
commitbc75fb54238091dd88e9acd4d4e6225b08dbf17c (patch)
tree8e594caaff8c96f4d526be419e1e788098830b80 /libavcodec/omx.c
parent5c0e2f839af1654c65170d336640d260bfffdefa (diff)
downloadffmpeg-bc75fb54238091dd88e9acd4d4e6225b08dbf17c.tar.gz
avcodec/omx: Reindentation
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/omx.c')
-rw-r--r--libavcodec/omx.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/libavcodec/omx.c b/libavcodec/omx.c
index 7086ddd3a4..4078ac84a4 100644
--- a/libavcodec/omx.c
+++ b/libavcodec/omx.c
@@ -596,45 +596,45 @@ static av_cold int omx_component_init(AVCodecContext *avctx, const char *role)
static av_cold void cleanup(OMXCodecContext *s)
{
- int i, executing;
+ int executing;
/* If the mutexes/condition variables have not been properly initialized,
* nothing has been initialized and locking the mutex might be unsafe. */
if (s->mutex_cond_inited_cnt == NB_MUTEX_CONDS) {
- pthread_mutex_lock(&s->state_mutex);
- executing = s->state == OMX_StateExecuting;
- pthread_mutex_unlock(&s->state_mutex);
+ pthread_mutex_lock(&s->state_mutex);
+ executing = s->state == OMX_StateExecuting;
+ pthread_mutex_unlock(&s->state_mutex);
- if (executing) {
- OMX_SendCommand(s->handle, OMX_CommandStateSet, OMX_StateIdle, NULL);
- wait_for_state(s, OMX_StateIdle);
- OMX_SendCommand(s->handle, OMX_CommandStateSet, OMX_StateLoaded, NULL);
- for (i = 0; i < s->num_in_buffers; i++) {
- OMX_BUFFERHEADERTYPE *buffer = get_buffer(&s->input_mutex, &s->input_cond,
- &s->num_free_in_buffers, s->free_in_buffers, 1);
- if (s->input_zerocopy)
- buffer->pBuffer = NULL;
- OMX_FreeBuffer(s->handle, s->in_port, buffer);
+ if (executing) {
+ OMX_SendCommand(s->handle, OMX_CommandStateSet, OMX_StateIdle, NULL);
+ wait_for_state(s, OMX_StateIdle);
+ OMX_SendCommand(s->handle, OMX_CommandStateSet, OMX_StateLoaded, NULL);
+ for (int i = 0; i < s->num_in_buffers; i++) {
+ OMX_BUFFERHEADERTYPE *buffer = get_buffer(&s->input_mutex, &s->input_cond,
+ &s->num_free_in_buffers, s->free_in_buffers, 1);
+ if (s->input_zerocopy)
+ buffer->pBuffer = NULL;
+ OMX_FreeBuffer(s->handle, s->in_port, buffer);
+ }
+ for (int i = 0; i < s->num_out_buffers; i++) {
+ OMX_BUFFERHEADERTYPE *buffer = get_buffer(&s->output_mutex, &s->output_cond,
+ &s->num_done_out_buffers, s->done_out_buffers, 1);
+ OMX_FreeBuffer(s->handle, s->out_port, buffer);
+ }
+ wait_for_state(s, OMX_StateLoaded);
}
- for (i = 0; i < s->num_out_buffers; i++) {
- OMX_BUFFERHEADERTYPE *buffer = get_buffer(&s->output_mutex, &s->output_cond,
- &s->num_done_out_buffers, s->done_out_buffers, 1);
- OMX_FreeBuffer(s->handle, s->out_port, buffer);
+ if (s->handle) {
+ s->omx_context->ptr_FreeHandle(s->handle);
+ s->handle = NULL;
}
- wait_for_state(s, OMX_StateLoaded);
- }
- if (s->handle) {
- s->omx_context->ptr_FreeHandle(s->handle);
- s->handle = NULL;
- }
- omx_deinit(s->omx_context);
- s->omx_context = NULL;
- av_freep(&s->in_buffer_headers);
- av_freep(&s->out_buffer_headers);
- av_freep(&s->free_in_buffers);
- av_freep(&s->done_out_buffers);
- av_freep(&s->output_buf);
+ omx_deinit(s->omx_context);
+ s->omx_context = NULL;
+ av_freep(&s->in_buffer_headers);
+ av_freep(&s->out_buffer_headers);
+ av_freep(&s->free_in_buffers);
+ av_freep(&s->done_out_buffers);
+ av_freep(&s->output_buf);
}
ff_pthread_free(s, omx_codec_context_offsets);
}