diff options
author | Edward Hervey <bilboed@bilboed.com> | 2014-11-19 09:46:24 +0100 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2015-03-11 10:39:38 +0100 |
commit | 693e6a76d86b0b50990c4ccf139391c96b0c3841 (patch) | |
tree | 993b30af4808670c62b5afa2729bfef6d2d8d7cc | |
parent | dbc9598a1349f9febd62a569d85bbc322d58bab4 (diff) |
mpegdemux: WIP: Disable usage of base_time adjustments
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.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gst/mpegdemux/gstmpegdemux.c b/gst/mpegdemux/gstmpegdemux.c index 072ac93fe..a6b2af719 100644 --- a/gst/mpegdemux/gstmpegdemux.c +++ b/gst/mpegdemux/gstmpegdemux.c @@ -601,7 +601,9 @@ gst_ps_demux_send_segment (GstPsDemux * demux, GstPsStream * 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 @@ -894,6 +896,9 @@ gst_ps_demux_flush (GstPsDemux * 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 @@ -1000,6 +1005,12 @@ gst_ps_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; } @@ -1723,7 +1734,11 @@ gst_ps_demux_parse_pack_start (GstPsDemux * 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; @@ -1733,6 +1748,9 @@ gst_ps_demux_parse_pack_start (GstPsDemux * 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) @@ -1746,6 +1764,7 @@ gst_ps_demux_parse_pack_start (GstPsDemux * 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; |