mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
asfdemux: Push all pending data on EOS
When on push mode and receiving an EOS event, asfdemux should push all pending data because we might be dealing with a broken file that has a preroll value higher than its actual length.
This commit is contained in:
parent
ec3b13a250
commit
36e12c92c1
1 changed files with 12 additions and 0 deletions
|
@ -106,6 +106,8 @@ static void gst_asf_demux_activate_stream (GstASFDemux * demux,
|
|||
AsfStream * stream);
|
||||
static GstStructure *gst_asf_demux_get_metadata_for_stream (GstASFDemux * d,
|
||||
guint stream_num);
|
||||
static GstFlowReturn gst_asf_demux_push_complete_payloads (GstASFDemux * demux,
|
||||
gboolean force);
|
||||
|
||||
GST_BOILERPLATE (GstASFDemux, gst_asf_demux, GstElement, GST_TYPE_ELEMENT);
|
||||
|
||||
|
@ -374,12 +376,22 @@ gst_asf_demux_sink_event (GstPad * pad, GstEvent * event)
|
|||
break;
|
||||
}
|
||||
case GST_EVENT_EOS:{
|
||||
GstFlowReturn flow;
|
||||
|
||||
if (demux->state == GST_ASF_DEMUX_STATE_HEADER) {
|
||||
GST_ELEMENT_ERROR (demux, STREAM, DEMUX,
|
||||
(_("This stream contains no data.")),
|
||||
("got eos and didn't receive a complete header object"));
|
||||
break;
|
||||
}
|
||||
flow = gst_asf_demux_push_complete_payloads (demux, TRUE);
|
||||
if (GST_FLOW_IS_FATAL (flow) || flow == GST_FLOW_NOT_LINKED) {
|
||||
GST_ELEMENT_ERROR (demux, STREAM, FAILED,
|
||||
(_("Internal data stream error.")),
|
||||
("streaming stopped, reason %s", gst_flow_get_name (flow)));
|
||||
break;
|
||||
}
|
||||
|
||||
GST_OBJECT_LOCK (demux);
|
||||
gst_adapter_clear (demux->adapter);
|
||||
GST_OBJECT_UNLOCK (demux);
|
||||
|
|
Loading…
Reference in a new issue