(aacparse, amrparse, flacparse). Fixes #580133.
gboolean flushing;
gint64 offset;
- gint64 pending_offset;
GList *pending_events;
{
gdouble rate, applied_rate;
GstFormat format;
- gint64 start, stop, pos;
+ gint64 start, stop, pos, offset = 0;
gboolean update;
gst_event_parse_new_segment_full (event, &update, &rate, &applied_rate,
/* stop time is allowed to be open-ended, but not start & pos */
seg_stop = GST_CLOCK_TIME_NONE;
- parse->priv->pending_offset = pos;
+ offset = pos;
if (gst_base_parse_bytepos_to_time (parse, start, &seg_start) &&
gst_base_parse_bytepos_to_time (parse, pos, &seg_pos)) {
gst_event_replace (eventp, event);
gst_event_unref (event);
handled = TRUE;
+
+ /* but finish the current segment */
+ GST_DEBUG_OBJECT (parse, "draining current segment");
+ gst_base_parse_drain (parse);
+ gst_adapter_clear (parse->adapter);
+ parse->priv->offset = offset;
break;
}
parse = GST_BASE_PARSE (GST_OBJECT_PARENT (pad));
bclass = GST_BASE_PARSE_GET_CLASS (parse);
- if (G_UNLIKELY (parse->pending_segment)) {
- parse->priv->offset = parse->priv->pending_offset;
-
- /* Make sure that adapter doesn't have any old data after
- newsegment has been pushed */
-
- /* FIXME: when non-flushing seek occurs, chain is still processing the
- data from old segment. If this processing loop is then interrupted
- (e.g. paused), chain function exists and next time it gets called
- all this old data gets lost and playback continues from new segment */
- gst_adapter_clear (parse->adapter);
- }
-
if (G_LIKELY (buffer)) {
GST_LOG_OBJECT (parse, "buffer size: %d, offset = %lld",
GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (buffer));
gboolean flushing;
gint64 offset;
- gint64 pending_offset;
GList *pending_events;
{
gdouble rate, applied_rate;
GstFormat format;
- gint64 start, stop, pos;
+ gint64 start, stop, pos, offset = 0;
gboolean update;
gst_event_parse_new_segment_full (event, &update, &rate, &applied_rate,
/* stop time is allowed to be open-ended, but not start & pos */
seg_stop = GST_CLOCK_TIME_NONE;
- parse->priv->pending_offset = pos;
+ offset = pos;
if (gst_base_parse_bytepos_to_time (parse, start, &seg_start) &&
gst_base_parse_bytepos_to_time (parse, pos, &seg_pos)) {
gst_event_replace (eventp, event);
gst_event_unref (event);
handled = TRUE;
+
+ /* but finish the current segment */
+ GST_DEBUG_OBJECT (parse, "draining current segment");
+ gst_base_parse_drain (parse);
+ gst_adapter_clear (parse->adapter);
+ parse->priv->offset = offset;
break;
}
parse = GST_BASE_PARSE (GST_OBJECT_PARENT (pad));
bclass = GST_BASE_PARSE_GET_CLASS (parse);
- if (G_UNLIKELY (parse->pending_segment)) {
- parse->priv->offset = parse->priv->pending_offset;
-
- /* Make sure that adapter doesn't have any old data after
- newsegment has been pushed */
-
- /* FIXME: when non-flushing seek occurs, chain is still processing the
- data from old segment. If this processing loop is then interrupted
- (e.g. paused), chain function exists and next time it gets called
- all this old data gets lost and playback continues from new segment */
- gst_adapter_clear (parse->adapter);
- }
-
if (G_LIKELY (buffer)) {
GST_LOG_OBJECT (parse, "buffer size: %d, offset = %lld",
GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (buffer));
gboolean flushing;
gint64 offset;
- gint64 pending_offset;
GList *pending_events;
{
gdouble rate, applied_rate;
GstFormat format;
- gint64 start, stop, pos;
+ gint64 start, stop, pos, offset = 0;
gboolean update;
gst_event_parse_new_segment_full (event, &update, &rate, &applied_rate,
/* stop time is allowed to be open-ended, but not start & pos */
seg_stop = GST_CLOCK_TIME_NONE;
- parse->priv->pending_offset = pos;
+ offset = pos;
if (gst_base_parse_bytepos_to_time (parse, start, &seg_start) &&
gst_base_parse_bytepos_to_time (parse, pos, &seg_pos)) {
gst_event_replace (eventp, event);
gst_event_unref (event);
handled = TRUE;
+
+ /* but finish the current segment */
+ GST_DEBUG_OBJECT (parse, "draining current segment");
+ gst_base_parse_drain (parse);
+ gst_adapter_clear (parse->priv->adapter);
+ parse->priv->offset = offset;
break;
}
parse = GST_BASE_PARSE (GST_OBJECT_PARENT (pad));
bclass = GST_BASE_PARSE_GET_CLASS (parse);
- /* Make sure that adapter doesn't have any old data after
- newsegment has been received and update our offset */
- if (G_UNLIKELY (parse->pending_segment)) {
- parse->priv->offset = parse->priv->pending_offset;
- gst_adapter_clear (parse->priv->adapter);
- }
-
gst_base_parse_update_upstream_durations (parse);
if (G_LIKELY (buffer)) {