gst/asfdemux/gstasfdemux.*: Subtract first timestamp from timestamps, so that stream starts from 0; makes live stream...

Original commit message from CVS:
Patch by: Fabrizio Gennari  <fabrizio dot ge at tiscali dot it>
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_setup_pad),
(gst_asf_demux_process_chunk):
* gst/asfdemux/gstasfdemux.h:
Subtract first timestamp from timestamps, so that
stream starts from 0; makes live streams that don't
start at 0 work again (fixes #317310, #336097).
This commit is contained in:
Fabrizio Gennari 2006-03-27 10:39:03 +00:00 committed by Tim-Philipp Müller
parent 4f7b8f0d3a
commit 08c4bd4168
3 changed files with 19 additions and 2 deletions

View file

@ -1,3 +1,14 @@
2006-03-27 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Fabrizio Gennari <fabrizio dot ge at tiscali dot it>
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_setup_pad),
(gst_asf_demux_process_chunk):
* gst/asfdemux/gstasfdemux.h:
Subtract first timestamp from timestamps, so that
stream starts from 0; makes live streams that don't
start at 0 work again (fixes #317310, #336097).
2006-03-27 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Christian Kirbach

View file

@ -828,6 +828,7 @@ gst_asf_demux_setup_pad (GstASFDemux * demux, GstPad * src_pad,
stream->frag_offset = 0;
stream->sequence = 0;
stream->delay = 0;
stream->first_pts = GST_CLOCK_TIME_NONE;
stream->last_pts = GST_CLOCK_TIME_NONE;
stream->fps_known = !is_video; /* bit hacky for audio */
stream->is_video = is_video;
@ -1812,7 +1813,10 @@ gst_asf_demux_process_chunk (GstASFDemux * demux,
if (segment_info->frag_offset == 0) {
/* new packet */
stream->sequence = segment_info->sequence;
demux->pts = segment_info->frag_timestamp - demux->preroll;
if (!GST_CLOCK_TIME_IS_VALID (stream->first_pts))
stream->first_pts = segment_info->frag_timestamp - demux->preroll;
demux->pts =
segment_info->frag_timestamp - demux->preroll - stream->first_pts;
/*
if (stream->is_video) {
@ -1871,7 +1875,8 @@ gst_asf_demux_process_chunk (GstASFDemux * demux,
#endif
stream->frag_offset = 0;
}
demux->pts = segment_info->frag_timestamp - demux->preroll;
demux->pts =
segment_info->frag_timestamp - demux->preroll - stream->first_pts;
/*
if (stream->is_video) {

View file

@ -47,6 +47,7 @@ typedef struct
guint32 frag_offset;
guint32 sequence;
guint64 delay;
guint64 first_pts;
guint64 last_pts;
GstBuffer *payload;