}
static GstBuffer *
-gst_flv_mux_create_metadata (GstFlvMux * mux)
+gst_flv_mux_create_metadata (GstFlvMux * mux, gboolean full)
{
const GstTagList *tags;
GstBuffer *script_tag, *tmp;
GST_WRITE_UINT32_BE (data + 1, n_tags);
script_tag = gst_buffer_join (script_tag, tmp);
+ if (!full)
+ goto tags;
+
/* Some players expect the 'duration' to be always set. Fill it out later,
after querying the pads or after getting EOS */
if (!mux->streamable) {
GST_DEBUG_OBJECT (mux, "not preallocating index, streamable mode");
}
+tags:
for (i = 0; tags && i < n_tags; i++) {
const gchar *tag_name =
gst_structure_nth_field_name ((const GstStructure *) tags, i);
}
}
+ if (!full)
+ goto end;
+
if (mux->duration == GST_CLOCK_TIME_NONE) {
GSList *l;
tags_written++;
}
+end:
+
+ if (!tags_written) {
+ gst_buffer_unref (script_tag);
+ goto exit;
+ }
+
tmp = gst_buffer_new_and_alloc (2 + 0 + 1);
data = GST_BUFFER_DATA (tmp);
data[0] = 0; /* 0 byte size */
GST_WRITE_UINT32_BE (data + 11 + 13 + 1, tags_written);
+exit:
return script_tag;
}
GstFlowReturn ret;
header = gst_flv_mux_create_header (mux);
- metadata = gst_flv_mux_create_metadata (mux);
+ metadata = gst_flv_mux_create_metadata (mux, TRUE);
video_codec_data = NULL;
audio_codec_data = NULL;
}
if (mux->new_tags) {
- GstBuffer *buf = gst_flv_mux_create_metadata (mux);
- gst_flv_mux_push (mux, buf);
+ GstBuffer *buf = gst_flv_mux_create_metadata (mux, FALSE);
+ if (buf)
+ gst_flv_mux_push (mux, buf);
mux->new_tags = FALSE;
}