omxvideodec: don't hold the stream lock when trying to push a frame
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 31 Aug 2018 21:28:03 +0000 (17:28 -0400)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 31 Aug 2018 21:42:07 +0000 (17:42 -0400)
The base class methods will lock this properly when needed, there seems
to be no need to lock it explicitly.

This allows the patch in gstvideodec for unlocking the stream lock
when pushing buffers out to work.

https://bugzilla.gnome.org/show_bug.cgi?id=715192

omx/gstomxvideodec.c

index 750abc2..848d0b1 100644 (file)
@@ -1718,7 +1718,6 @@ gst_omx_video_dec_loop (GstOMXVideoDec * self)
       gst_omx_buffer_flags_to_string (buf->omx_buf->nFlags),
       (guint64) GST_OMX_GET_TICKS (buf->omx_buf->nTimeStamp));
 
-  GST_VIDEO_DECODER_STREAM_LOCK (self);
   frame = gst_omx_video_find_nearest_frame (buf,
       gst_video_decoder_get_frames (GST_VIDEO_DECODER (self)));
 
@@ -1862,13 +1861,13 @@ gst_omx_video_dec_loop (GstOMXVideoDec * self)
       goto release_error;
   }
 
+  GST_VIDEO_DECODER_STREAM_LOCK (self);
   self->downstream_flow_ret = flow_ret;
+  GST_VIDEO_DECODER_STREAM_UNLOCK (self);
 
   if (flow_ret != GST_FLOW_OK)
     goto flow_error;
 
-  GST_VIDEO_DECODER_STREAM_UNLOCK (self);
-
   return;
 
 component_error:
@@ -1941,7 +1940,6 @@ flow_error:
       GST_DEBUG_OBJECT (self, "Flushing -- stopping task");
     }
     gst_omx_video_dec_pause_loop (self, flow_ret);
-    GST_VIDEO_DECODER_STREAM_UNLOCK (self);
     return;
   }