qtdemux: Don't post tags if there are none

And make all code go through _post_global_tags.
This commit is contained in:
Edward Hervey 2010-09-22 12:56:00 +02:00
parent f5c65a919f
commit 6ce6ad41d5

View file

@ -1721,6 +1721,7 @@ gst_qtdemux_change_state (GstElement * element, GstStateChange transition)
static void static void
qtdemux_post_global_tags (GstQTDemux * qtdemux) qtdemux_post_global_tags (GstQTDemux * qtdemux)
{ {
if (qtdemux->tag_list) {
/* all header tags ready and parsed, push them */ /* all header tags ready and parsed, push them */
GST_INFO_OBJECT (qtdemux, "posting global tags: %" GST_PTR_FORMAT, GST_INFO_OBJECT (qtdemux, "posting global tags: %" GST_PTR_FORMAT,
qtdemux->tag_list); qtdemux->tag_list);
@ -1728,6 +1729,7 @@ qtdemux_post_global_tags (GstQTDemux * qtdemux)
gst_element_post_message (GST_ELEMENT (qtdemux), gst_element_post_message (GST_ELEMENT (qtdemux),
gst_message_new_tag (GST_OBJECT (qtdemux), gst_message_new_tag (GST_OBJECT (qtdemux),
gst_tag_list_copy (qtdemux->tag_list))); gst_tag_list_copy (qtdemux->tag_list)));
}
} }
static void static void
@ -7370,13 +7372,7 @@ qtdemux_parse_tree (GstQTDemux * qtdemux)
if (qtdemux->n_streams == 1 && qtdemux->streams[0]->redirect_uri != NULL) { if (qtdemux->n_streams == 1 && qtdemux->streams[0]->redirect_uri != NULL) {
GstMessage *m; GstMessage *m;
/* Post tags now as there is probably no data on this stream */ qtdemux_post_global_tags (qtdemux);
GST_INFO_OBJECT (qtdemux, "posting global tags: %" GST_PTR_FORMAT,
qtdemux->tag_list);
/* post now, send event on pads later */
gst_element_post_message (GST_ELEMENT (qtdemux),
gst_message_new_tag (GST_OBJECT (qtdemux),
gst_tag_list_copy (qtdemux->tag_list)));
GST_INFO_OBJECT (qtdemux, "Issuing a redirect due to a single track with " GST_INFO_OBJECT (qtdemux, "Issuing a redirect due to a single track with "
"an external content"); "an external content");