summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2014-11-19 09:46:24 +0100
committerEdward Hervey <bilboed@bilboed.com>2014-11-19 09:46:24 +0100
commitb6dcbddc0813a5e6991e8e491110c27c5a5dcd41 (patch)
tree455954621741623d0d576a85035347b46d3636b2
parentbbded10e2e0493ae0a2608082297cff227cce07d (diff)
mpegdemux: WIP: Disable usage of base_time adjustmentsWIP
This is a temporary modification until we figure out exactly how input TIME segment interact with all the other variables.
-rw-r--r--gst/mpegdemux/gstmpegdemux.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/gst/mpegdemux/gstmpegdemux.c b/gst/mpegdemux/gstmpegdemux.c
index 2ebdf79e7..e57e6dbb1 100644
--- a/gst/mpegdemux/gstmpegdemux.c
+++ b/gst/mpegdemux/gstmpegdemux.c
@@ -584,7 +584,9 @@ gst_flups_demux_send_segment (GstFluPSDemux * demux, GstFluPSStream * stream,
segment.start += demux->base_time;
if (GST_CLOCK_TIME_IS_VALID (segment.stop))
segment.stop += demux->base_time;
- segment.time = segment.start - demux->base_time;
+ /* EDWARD/WIP: Don't override the notion of segment.time from upstream
+ * Until we figure out how all variables related to each other */
+ /* segment.time = segment.start - demux->base_time; */
}
GST_INFO_OBJECT (demux, "sending segment event %" GST_SEGMENT_FORMAT
@@ -878,6 +880,9 @@ gst_flups_demux_flush (GstFluPSDemux * demux)
demux->adapter_offset = G_MAXUINT64;
demux->current_scr = G_MAXUINT64;
demux->bytes_since_scr = 0;
+ /* EDWARD/WIP: Reset base_time/first_scr on flushes/reset */
+ demux->base_time = GST_CLOCK_TIME_NONE;
+ demux->first_scr = G_MAXUINT64;
}
static inline void
@@ -984,6 +989,12 @@ gst_flups_demux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
/* we expect our timeline (SCR, PTS) to match the one from upstream,
* if not, will adjust with offset later on */
gst_segment_copy_into (segment, &demux->src_segment);
+ /* EDWARD/WIP: The input segment start/stop values don't matter in
+ * the output. What will matter is the time/base fields which we
+ * carry over. */
+ demux->src_segment.start = 0;
+ if (GST_CLOCK_TIME_IS_VALID (segment->stop))
+ demux->src_segment.stop = segment->stop - segment->start;
/* accept upstream segment without adjusting */
demux->adjust_segment = FALSE;
}
@@ -1698,7 +1709,11 @@ gst_flups_demux_parse_pack_start (GstFluPSDemux * demux)
/* keep the first src in order to calculate delta time */
if (G_UNLIKELY (demux->first_scr == G_MAXUINT64)) {
+#if 0
+ /* EDWARD/WIP: Disable segment adjustments until we figure out
+ * how base_time and other variables related to each other */
gint64 diff;
+#endif
demux->first_scr = scr;
demux->first_scr_offset = demux->cur_scr_offset;
@@ -1708,6 +1723,9 @@ gst_flups_demux_parse_pack_start (GstFluPSDemux * demux)
/* at begin consider the new_rate as the scr rate, bytes/clock ticks */
scr_rate_n = new_rate;
scr_rate_d = CLOCK_FREQ;
+#if 0
+ /* EDWARD/WIP: Disable segment adjustments until we figure out
+ * how base_time and other variables related to each other */
/* our SCR timeline might have offset wrt upstream timeline */
if (demux->sink_segment.format == GST_FORMAT_TIME) {
if (demux->sink_segment.start > demux->base_time)
@@ -1721,6 +1739,7 @@ gst_flups_demux_parse_pack_start (GstFluPSDemux * demux)
demux->base_time += diff;
}
}
+#endif
} else if (G_LIKELY (demux->first_scr_offset != demux->cur_scr_offset)) {
/* estimate byte rate related to the SCR */
scr_rate_n = demux->cur_scr_offset - demux->first_scr_offset;