summaryrefslogtreecommitdiffstats
path: root/gst/flv
diff options
context:
space:
mode:
Diffstat (limited to 'gst/flv')
-rw-r--r--gst/flv/gstflvdemux.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gst/flv/gstflvdemux.c b/gst/flv/gstflvdemux.c
index 59a12d03..1f700020 100644
--- a/gst/flv/gstflvdemux.c
+++ b/gst/flv/gstflvdemux.c
@@ -1183,11 +1183,14 @@ gst_flv_demux_set_index (GstElement * element, GstIndex * index)
GST_OBJECT_LOCK (demux);
if (demux->index)
gst_object_unref (demux->index);
- demux->index = gst_object_ref (index);
- GST_OBJECT_UNLOCK (demux);
+ if (index) {
+ demux->index = gst_object_ref (index);
+ gst_index_get_writer_id (index, GST_OBJECT (element), &demux->index_id);
+ demux->own_index = FALSE;
+ } else
+ demux->index = NULL;
- gst_index_get_writer_id (index, GST_OBJECT (element), &demux->index_id);
- demux->own_index = FALSE;
+ GST_OBJECT_UNLOCK (demux);
}
static GstIndex *