omxvideodec: Fix deadlock if ::reset is called before finding the corresponding frame of a decoded buffer

This commit is contained in:
Sebastian Dröge 2011-10-20 14:32:40 +02:00
parent f93a45fb66
commit 2f2c17a1b5

View file

@ -390,6 +390,15 @@ _find_nearest_frame (GstOMXVideoDec * self, GstOMXBuffer * buf)
guint64 best_diff = G_MAXUINT64;
BufferIdentification *best_id = NULL;
/* This prevents a deadlock between the srcpad stream
* lock and the videocodec stream lock, if ::reset()
* is called at the wrong time
*/
if (gst_omx_port_is_flushing (self->out_port)) {
GST_DEBUG_OBJECT (self, "Flushing -- returning NULL");
return NULL;
}
GST_BASE_VIDEO_CODEC_STREAM_LOCK (self);
for (l = GST_BASE_VIDEO_CODEC (self)->frames; l; l = l->next) {
GstVideoFrame *tmp = l->data;