summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2014-10-22 14:43:43 (GMT)
committerEdward Hervey <bilboed@bilboed.com>2015-02-26 06:52:05 (GMT)
commitc1d2254b23c1ca631c28ebe14dea2f0e1c9bc1a2 (patch)
treebab9c81a7a08ea54febd57d1e64a4a2183d3ba43
parent075def0f9771dd89503808e7d18f0569f7a76690 (diff)
downloadgstreamer-c1d2254b23c1ca631c28ebe14dea2f0e1c9bc1a2.tar.gz
gstreamer-c1d2254b23c1ca631c28ebe14dea2f0e1c9bc1a2.tar.xz
baseparse: Don't emit errors on EOS if we saw GAP events
If we saw GAP events (meaning the streams is advancing) before we get EOS, we should not post an ERROR, since it is not fatal. https://bugzilla.gnome.org/show_bug.cgi?id=745143
-rw-r--r--libs/gst/base/gstbaseparse.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c
index 9605e38..3ea05e9 100644
--- a/libs/gst/base/gstbaseparse.c
+++ b/libs/gst/base/gstbaseparse.c
@@ -262,6 +262,7 @@ struct _GstBaseParsePrivate
gboolean discont;
gboolean flushing;
gboolean drain;
+ gboolean saw_gaps;
gint64 offset;
gint64 sync_offset;
@@ -794,6 +795,7 @@ gst_base_parse_reset (GstBaseParse * parse)
parse->priv->min_frame_size = 1;
parse->priv->discont = TRUE;
parse->priv->flushing = FALSE;
+ parse->priv->saw_gaps = FALSE;
parse->priv->offset = 0;
parse->priv->sync_offset = 0;
parse->priv->update_interval = -1;
@@ -1172,14 +1174,15 @@ gst_base_parse_sink_event_default (GstBaseParse * parse, GstEvent * event)
gst_base_parse_finish_fragment (parse, TRUE);
/* If we STILL have zero frames processed, fire an error */
- if (parse->priv->framecount == 0) {
+ if (parse->priv->framecount == 0 && !parse->priv->saw_gaps) {
GST_ELEMENT_ERROR (parse, STREAM, WRONG_TYPE,
("No valid frames found before end of stream"), (NULL));
}
/* newsegment and other serialized events before eos */
gst_base_parse_push_pending_events (parse);
- if (parse->priv->framecount < MIN_FRAMES_TO_POST_BITRATE) {
+ if (!parse->priv->saw_gaps
+ && parse->priv->framecount < MIN_FRAMES_TO_POST_BITRATE) {
/* We've not posted bitrate tags yet - do so now */
gst_base_parse_post_bitrates (parse, TRUE, TRUE, TRUE);
}
@@ -1220,6 +1223,7 @@ gst_base_parse_sink_event_default (GstBaseParse * parse, GstEvent * event)
else
gst_base_parse_finish_fragment (parse, TRUE);
forward_immediate = TRUE;
+ parse->priv->saw_gaps = TRUE;
break;
}
case GST_EVENT_TAG: