[gst-cvs] gst-plugins-ugly: asfdemux: Push all pending data on EOS

Thiago Sousa Santos thiagoss at kemper.freedesktop.org
Thu Jun 24 15:48:23 PDT 2010


Module: gst-plugins-ugly
Branch: master
Commit: 36e12c92c124d7d3e6ca597fb395ec810a51531a
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-ugly/commit/?id=36e12c92c124d7d3e6ca597fb395ec810a51531a

Author: Thiago Santos <thiago.sousa.santos at collabora.co.uk>
Date:   Thu Jun 24 19:46:39 2010 -0300

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.

---

 gst/asfdemux/gstasfdemux.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c
index 8848afc..55c73bc 100644
--- a/gst/asfdemux/gstasfdemux.c
+++ b/gst/asfdemux/gstasfdemux.c
@@ -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);





More information about the Gstreamer-commits mailing list