summaryrefslogtreecommitdiff
path: root/gst/asfdemux
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-09-23 20:23:40 +0200
committerSebastian Dröge <sebastian@centricular.com>2015-09-25 23:53:47 +0200
commitf501188191c63bc531437d6311f46a9a7d535f6b (patch)
tree7874d6f0012e4c51dbb2e70319e7e218f669b5f1 /gst/asfdemux
parentc526153ec9341183eef05da6918e7e94bcd2db29 (diff)
downloadgstreamer-plugins-ugly-f501188191c63bc531437d6311f46a9a7d535f6b.tar.gz
asfdemux: Update segment.position when pushing buffers
Without this, non-flushing seeks are not going to work well. https://bugzilla.gnome.org/show_bug.cgi?id=755469
Diffstat (limited to 'gst/asfdemux')
-rw-r--r--gst/asfdemux/gstasfdemux.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c
index 6c2544b6..2a92ac22 100644
--- a/gst/asfdemux/gstasfdemux.c
+++ b/gst/asfdemux/gstasfdemux.c
@@ -1595,6 +1595,8 @@ gst_asf_demux_push_complete_payloads (GstASFDemux * demux, gboolean force)
while ((stream = gst_asf_demux_find_stream_with_complete_payload (demux))) {
AsfPayload *payload;
+ GstClockTime timestamp = GST_CLOCK_TIME_NONE;
+ GstClockTime duration = GST_CLOCK_TIME_NONE;
/* wait until we had a chance to "lock on" some payload's timestamp */
if (G_UNLIKELY (demux->need_newsegment
@@ -1708,16 +1710,20 @@ gst_asf_demux_push_complete_payloads (GstASFDemux * demux, gboolean force)
* typically useful for live src, but might (unavoidably) mess with
* position reporting if a live src is playing not so live content
* (e.g. rtspsrc taking some time to fall back to tcp) */
- GST_BUFFER_PTS (payload->buf) = payload->ts;
- if (GST_BUFFER_PTS_IS_VALID (payload->buf)) {
- GST_BUFFER_PTS (payload->buf) += demux->in_gap;
+ timestamp = payload->ts;
+ if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
+ timestamp += demux->in_gap;
}
+
+ GST_BUFFER_PTS (payload->buf) = timestamp;
+
if (payload->duration == GST_CLOCK_TIME_NONE
- && stream->ext_props.avg_time_per_frame != 0)
- GST_BUFFER_DURATION (payload->buf) =
- stream->ext_props.avg_time_per_frame * 100;
- else
- GST_BUFFER_DURATION (payload->buf) = payload->duration;
+ && stream->ext_props.avg_time_per_frame != 0) {
+ duration = stream->ext_props.avg_time_per_frame * 100;
+ } else {
+ duration = payload->duration;
+ }
+ GST_BUFFER_DURATION (payload->buf) = duration;
/* FIXME: we should really set durations on buffers if we can */
@@ -1734,6 +1740,13 @@ gst_asf_demux_push_complete_payloads (GstASFDemux * demux, gboolean force)
stream->first_buffer = FALSE;
}
+ if (GST_CLOCK_TIME_IS_VALID (timestamp)
+ && timestamp > demux->segment.position) {
+ demux->segment.position = timestamp;
+ if (GST_CLOCK_TIME_IS_VALID (duration))
+ demux->segment.position += timestamp;
+ }
+
ret = gst_pad_push (stream->pad, payload->buf);
ret = gst_flow_combiner_update_flow (demux->flowcombiner, ret);
} else {