From ec9add84a8b1afcc79725f46489c7baea9a7a64d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 19 Feb 2010 00:39:50 +0000 Subject: [PATCH] flvdemux: remove static keyword from variables that shouldn't be static Multiple flvparse/flvdemux instances should be able to operate without trampling over each other by accidentally re-using the same (static) variables. (Spotted by Mark Nauwelaerts) --- gst/flv/gstflvparse.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gst/flv/gstflvparse.c b/gst/flv/gstflvparse.c index 55fd87a..935af21 100644 --- a/gst/flv/gstflvparse.c +++ b/gst/flv/gstflvparse.c @@ -424,8 +424,8 @@ gst_flv_parse_tag_script (GstFLVDemux * demux, GstBuffer * buffer) && !demux->random_access) { /* If an index was found and we're in push mode, insert associations */ for (i = 0; i < MIN (demux->times->len, demux->filepositions->len); i++) { + GstIndexAssociation associations[2]; guint64 time, fileposition; - static GstIndexAssociation associations[2]; time = g_array_index (demux->times, gdouble, i) * GST_SECOND; fileposition = g_array_index (demux->filepositions, gdouble, i); @@ -437,8 +437,7 @@ gst_flv_parse_tag_script (GstFLVDemux * demux, GstBuffer * buffer) associations[1].value = fileposition; gst_index_add_associationv (demux->index, demux->index_id, - GST_ASSOCIATION_FLAG_KEY_UNIT, 2, - (const GstIndexAssociation *) &associations); + GST_ASSOCIATION_FLAG_KEY_UNIT, 2, associations); } demux->indexed = TRUE; } @@ -1249,7 +1248,8 @@ gst_flv_parse_tag_timestamp (GstFLVDemux * demux, GstBuffer * buffer, if (demux->index && !demux->indexed && (type == 9 || (type == 8 && !demux->has_video))) { - static GstIndexAssociation associations[2]; + GstIndexAssociation associations[2]; + GST_LOG_OBJECT (demux, "adding association %" GST_TIME_FORMAT "-> %" G_GUINT64_FORMAT, GST_TIME_ARGS (ret), demux->offset); @@ -1261,7 +1261,7 @@ gst_flv_parse_tag_timestamp (GstFLVDemux * demux, GstBuffer * buffer, gst_index_add_associationv (demux->index, demux->index_id, (keyframe) ? GST_ASSOCIATION_FLAG_KEY_UNIT : GST_ASSOCIATION_FLAG_NONE, - 2, (const GstIndexAssociation *) &associations); + 2, associations); } if (demux->duration == GST_CLOCK_TIME_NONE || demux->duration < ret) -- 2.7.4