summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2009-06-28 17:04:00 +0200
committerEdward Hervey <bilboed@bilboed.com>2009-06-28 17:33:51 +0200
commit725da8579bae51f256812666651555f3f0f1be50 (patch)
treee37423b4b371addbb5cfa852943c5bff7f3fe06f
parent99d9b3438534a303e7b933ad4c755dca7bcd66d0 (diff)
asfdemux: Use the average frame duration for buffers without a duration.
This will still cause some timestamp jitter, but giving a hint as to the duration rather than nothing seems to be a better idea. Also, this allows some scenarios (like remuxing with asfmux) to estimate the total duration using the accumulated packet duration (which will be correct).
-rw-r--r--gst/asfdemux/gstasfdemux.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c
index 3debb461..8300b0a2 100644
--- a/gst/asfdemux/gstasfdemux.c
+++ b/gst/asfdemux/gstasfdemux.c
@@ -1314,7 +1314,11 @@ gst_asf_demux_push_complete_payloads (GstASFDemux * demux, gboolean force)
* 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_TIMESTAMP (payload->buf) = payload->ts + demux->in_gap;
- GST_BUFFER_DURATION (payload->buf) = payload->duration;
+ if (payload->duration == GST_CLOCK_TIME_NONE)
+ GST_BUFFER_DURATION (payload->buf) =
+ stream->ext_props.avg_time_per_frame * 100;
+ else
+ GST_BUFFER_DURATION (payload->buf) = payload->duration;
/* FIXME: we should really set durations on buffers if we can */