summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2010-12-10 15:59:49 +0100
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2011-01-28 12:16:56 +0100
commite54e2a9616fe759b09a6908bab4535d09bafbe6f (patch)
tree5d0d8d7824f4f4c0e1e7bfa8cc6df0499d6705fa
parent695c9599f4ff2fa586c8d62e39753cf92fa8f9a7 (diff)
baseparse: fix reverse playback handling
-rw-r--r--gst/audioparsers/gstbaseparse.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gst/audioparsers/gstbaseparse.c b/gst/audioparsers/gstbaseparse.c
index 1dee0346e..aee1c9af1 100644
--- a/gst/audioparsers/gstbaseparse.c
+++ b/gst/audioparsers/gstbaseparse.c
@@ -2153,11 +2153,17 @@ gst_base_parse_handle_previous_fragment (GstBaseParse * parse)
if (ret != GST_FLOW_OK)
goto exit;
+ /* offset will increase again as fragment is processed/parsed */
+ parse->priv->last_offset = offset;
+
gst_adapter_push (parse->adapter, buffer);
ret = gst_base_parse_process_fragment (parse, FALSE);
if (ret != GST_FLOW_OK)
goto exit;
+ /* force previous fragment */
+ parse->priv->offset = -1;
+
exit:
return ret;
}
@@ -2275,7 +2281,9 @@ gst_base_parse_loop (GstPad * pad)
* first fragment (closest to stop time) is handled normally below,
* then we pull in fragments going backwards */
if (parse->segment.rate < 0.0) {
- if (GST_CLOCK_TIME_IS_VALID (parse->priv->last_ts)) {
+ /* check if we jumped back to a previous fragment,
+ * which is a post-first fragment */
+ if (parse->priv->offset < 0) {
ret = gst_base_parse_handle_previous_fragment (parse);
goto done;
}
@@ -2294,6 +2302,8 @@ gst_base_parse_loop (GstPad * pad)
GST_DEBUG_OBJECT (parse, "downstream has reached end of segment");
/* push what was accumulated during loop run */
gst_base_parse_process_fragment (parse, TRUE);
+ /* force previous fragment */
+ parse->priv->offset = -1;
ret = GST_FLOW_OK;
}