summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiago.sousa.santos@collabora.com>2013-09-06 15:36:12 -0300
committerThiago Santos <thiago.sousa.santos@collabora.com>2013-09-10 12:14:47 -0300
commit1618084bc8730343b7e572f8076d39dafafb7f02 (patch)
tree14c4ab1adc1392f696fd158f208460720b800f51
parent7ecd5b1108a98fd3f7a2d834869b41f18a13b64c (diff)
oggdemux: check for full eos after a pad goes eos in push mode
After a pad is on EOS, verify if all pads are EOS and return upstream, avoiding keeping the buffer flow without having more data to push
-rw-r--r--ext/ogg/gstoggdemux.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c
index 7a68668df..2ca3a7bf6 100644
--- a/ext/ogg/gstoggdemux.c
+++ b/ext/ogg/gstoggdemux.c
@@ -146,6 +146,7 @@ static GstOggPad *gst_ogg_chain_get_stream (GstOggChain * chain,
static GstFlowReturn gst_ogg_demux_combine_flows (GstOggDemux * ogg,
GstOggPad * pad, GstFlowReturn ret);
static void gst_ogg_demux_sync_streams (GstOggDemux * ogg);
+static gboolean gst_ogg_demux_check_eos (GstOggDemux * ogg);
static GstCaps *gst_ogg_demux_set_header_on_caps (GstOggDemux * ogg,
GstCaps * caps, GList * headers);
@@ -733,11 +734,17 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet,
GST_TIME_ARGS (current_time));
/* check stream eos */
- if ((ogg->segment.rate > 0.0 && ogg->segment.stop != GST_CLOCK_TIME_NONE &&
- current_time >= ogg->segment.stop) ||
- (ogg->segment.rate < 0.0 && current_time <= ogg->segment.start)) {
+ if (!delta_unit &&
+ ((ogg->segment.rate > 0.0 &&
+ ogg->segment.stop != GST_CLOCK_TIME_NONE &&
+ current_time >= ogg->segment.stop) ||
+ (ogg->segment.rate < 0.0 && current_time <= ogg->segment.start))) {
GST_DEBUG_OBJECT (ogg, "marking pad %p EOS", pad);
pad->is_eos = TRUE;
+
+ if (cret == GST_FLOW_OK && gst_ogg_demux_check_eos (ogg)) {
+ cret = GST_FLOW_EOS;
+ }
}
done: