omx: Take lock on EOS to update the flow return value
authorJosep Torra <n770galaxy@gmail.com>
Mon, 20 May 2013 10:06:34 +0000 (12:06 +0200)
committerJosep Torra <n770galaxy@gmail.com>
Mon, 20 May 2013 10:06:34 +0000 (12:06 +0200)
Fixes "GThread-ERROR **: file gthread-posix.c: line 171
(g_mutex_free_posix_impl): error 'Device or resource busy' during
'pthread_mutex_destroy ((pthread_mutex_t *) mutex)'" in _finalize.

omx/gstomxaudioenc.c
omx/gstomxvideodec.c
omx/gstomxvideoenc.c

index 2a8a090..538902c 100644 (file)
@@ -514,6 +514,8 @@ eos:
       flow_ret = GST_FLOW_EOS;
     }
     g_mutex_unlock (&self->drain_lock);
+
+    GST_AUDIO_ENCODER_STREAM_LOCK (self);
     self->downstream_flow_ret = flow_ret;
 
     /* Here we fallback and pause the task for the EOS case */
index 5378f60..74a71d4 100644 (file)
@@ -2156,6 +2156,8 @@ eos:
       flow_ret = GST_FLOW_EOS;
     }
     g_mutex_unlock (&self->drain_lock);
+
+    GST_VIDEO_DECODER_STREAM_LOCK (self);
     self->downstream_flow_ret = flow_ret;
 
     /* Here we fallback and pause the task for the EOS case */
index 4506992..a399c07 100644 (file)
@@ -908,6 +908,8 @@ eos:
       flow_ret = GST_FLOW_EOS;
     }
     g_mutex_unlock (&self->drain_lock);
+
+    GST_VIDEO_ENCODER_STREAM_LOCK (self);
     self->downstream_flow_ret = flow_ret;
 
     /* Here we fallback and pause the task for the EOS case */