mpeg2dec: don't deadlock when setting an index

This commit is contained in:
Tim-Philipp Müller 2011-04-19 15:24:03 +01:00
parent 894760b682
commit 7bccbfdd48

View file

@ -299,10 +299,11 @@ gst_mpeg2dec_set_index (GstElement * element, GstIndex * index)
mpeg2dec->index_id = 0; mpeg2dec->index_id = 0;
if (index) { if (index) {
mpeg2dec->index = gst_object_ref (index); mpeg2dec->index = gst_object_ref (index);
gst_index_get_writer_id (index, GST_OBJECT (element), &mpeg2dec->index_id);
} }
GST_OBJECT_UNLOCK (mpeg2dec); GST_OBJECT_UNLOCK (mpeg2dec);
/* object lock might be taken again */
if (index)
gst_index_get_writer_id (index, GST_OBJECT (element), &mpeg2dec->index_id);
} }
static GstIndex * static GstIndex *