/* 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++) {
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);
GST_LOG_OBJECT (demux, "adding association %" GST_TIME_FORMAT "-> %"
G_GUINT64_FORMAT, GST_TIME_ARGS (time), fileposition);
- gst_index_add_association (demux->index, demux->index_id,
- GST_ASSOCIATION_FLAG_KEY_UNIT, GST_FORMAT_TIME, time,
- GST_FORMAT_BYTES, fileposition, NULL);
+ associations[0].format = GST_FORMAT_TIME;
+ associations[0].value = time;
+ associations[1].format = GST_FORMAT_BYTES;
+ associations[1].value = fileposition;
+
+ gst_index_add_associationv (demux->index, demux->index_id,
+ GST_ASSOCIATION_FLAG_KEY_UNIT, 2,
+ (const GstIndexAssociation *) &associations);
}
demux->indexed = TRUE;
}
if (demux->index && !demux->indexed && (type == 9 || (type == 8
&& !demux->has_video))) {
+ static GstIndexAssociation associations[2];
GST_LOG_OBJECT (demux,
"adding association %" GST_TIME_FORMAT "-> %" G_GUINT64_FORMAT,
GST_TIME_ARGS (ret), demux->offset);
- gst_index_add_association (demux->index, demux->index_id,
+
+ associations[0].format = GST_FORMAT_TIME;
+ associations[0].value = ret;
+ associations[1].format = GST_FORMAT_BYTES;
+ associations[1].value = demux->offset;
+
+ gst_index_add_associationv (demux->index, demux->index_id,
(keyframe) ? GST_ASSOCIATION_FLAG_KEY_UNIT : GST_ASSOCIATION_FLAG_NONE,
- GST_FORMAT_TIME, ret, GST_FORMAT_BYTES, demux->offset, NULL);
+ 2, (const GstIndexAssociation *) &associations);
}
if (demux->duration == GST_CLOCK_TIME_NONE || demux->duration < ret)