oggdemux: post/send tags with the container-format tag

For this to work properly, theoradec and vorbisdec need to put
tag events received from upstream into the pending_events list
so they get pushed out after any newsegment event, not before.
This commit is contained in:
Tim-Philipp Müller 2009-06-14 22:13:41 +01:00
parent 81a0a98611
commit 12134979a2
3 changed files with 30 additions and 2 deletions

View file

@ -1834,9 +1834,13 @@ gst_ogg_demux_activate_chain (GstOggDemux * ogg, GstOggChain * chain,
gst_element_no_more_pads (GST_ELEMENT (ogg));
/* FIXME, must be sent from the streaming thread */
if (event)
if (event) {
gst_ogg_demux_send_event (ogg, event);
gst_element_found_tags (GST_ELEMENT_CAST (ogg),
gst_tag_list_new_full (GST_TAG_CONTAINER_FORMAT, "Ogg", NULL));
}
GST_DEBUG_OBJECT (ogg, "starting chain");
/* then send out any queued buffers */
@ -2957,7 +2961,7 @@ gst_ogg_demux_send_event (GstOggDemux * ogg, GstEvent * event)
GstOggPad *pad = g_array_index (chain->streams, GstOggPad *, i);
gst_event_ref (event);
GST_DEBUG_OBJECT (ogg, "Pushing event on pad %p", pad);
GST_DEBUG_OBJECT (pad, "Pushing event %" GST_PTR_FORMAT, event);
gst_pad_push_event (GST_PAD (pad), event);
}
}

View file

@ -721,6 +721,18 @@ theora_dec_sink_event (GstPad * pad, GstEvent * event)
}
break;
}
case GST_EVENT_TAG:
{
if (dec->have_header)
/* and forward */
ret = gst_pad_push_event (dec->srcpad, event);
else {
/* store it to send once we're initialized */
dec->pendingevents = g_list_append (dec->pendingevents, event);
ret = TRUE;
}
break;
}
default:
ret = gst_pad_push_event (dec->srcpad, event);
break;

View file

@ -547,6 +547,18 @@ vorbis_dec_sink_event (GstPad * pad, GstEvent * event)
}
break;
}
case GST_EVENT_TAG:
{
if (dec->initialized)
/* and forward */
ret = gst_pad_push_event (dec->srcpad, event);
else {
/* store it to send once we're initialized */
dec->pendingevents = g_list_append (dec->pendingevents, event);
ret = TRUE;
}
break;
}
default:
ret = gst_pad_push_event (dec->srcpad, event);
break;