wtay gst-plugins-bad: gst-plugins-bad/ gst-plugins-bad/gst/mpegdemux/
[email protected] Mon, 29 Dec 2008 10:22:40 -0800 (PST)
| Newsgroups | gmane.comp.video.gstreamer.cvs |
|---|---|
| Message-ID | <[email protected]> |
CVS Root: /cvs/gstreamer
Module: gst-plugins-bad
Changes by: wtay
Date: Mon Dec 29 2008 18:22:40 UTC
Log message:
* gst/mpegdemux/gstmpegdemux.c: (gst_flups_demux_src_query),
(gst_flups_demux_parse_pack_start):
Use the adjusted SCR for calculating the mux rate.
Don't update the rate estimation after a discont.
Modified files:
. : ChangeLog
gst/mpegdemux : gstmpegdemux.c
Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ChangeLog.diff?r1=1.3842&r2=1.3843
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/mpegdemux/gstmpegdemux.c.diff?r1=1.9&r2=1.10
====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-bad/ChangeLog,v
retrieving revision 1.3842
retrieving revision 1.3843
diff -u -d -r1.3842 -r1.3843
--- ChangeLog 29 Dec 2008 17:55:16 -0000 1.3842
+++ ChangeLog 29 Dec 2008 18:22:25 -0000 1.3843
@@ -1,5 +1,12 @@
2008-12-29 Wim Taymans <[email protected]>
+ * gst/mpegdemux/gstmpegdemux.c: (gst_flups_demux_src_query),
+ (gst_flups_demux_parse_pack_start):
+ Use the adjusted SCR for calculating the mux rate.
+ Don't update the rate estimation after a discont.
+
+2008-12-29 Wim Taymans <[email protected]>
* gst/mpegdemux/gstmpegdemux.c: (gst_flups_demux_send_data):
* gst/mpegdemux/gstmpegdemux.h:
The position member in the newsegment event corresponds to the
Index: gstmpegdemux.c
RCS file: /cvs/gstreamer/gst-plugins-bad/gst/mpegdemux/gstmpegdemux.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- gstmpegdemux.c 29 Dec 2008 17:55:18 -0000 1.9
+++ gstmpegdemux.c 29 Dec 2008 18:22:26 -0000 1.10
@@ -960,8 +960,14 @@
gst_query_parse_duration (query, &format, &duration);
+ GST_LOG_OBJECT (demux,
+ "query on peer pad reported bytes %" G_GUINT64_FORMAT, duration);
duration = BYTES_TO_GSTTIME (duration);
+ GST_LOG_OBJECT (demux, "converted to time %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (duration));
gst_query_set_duration (query, GST_FORMAT_TIME, duration);
res = TRUE;
break;
@@ -1013,6 +1019,8 @@
guint length;
guint32 scr1, scr2;
guint64 scr, scr_adjusted, new_rate;
+ guint64 scr_rate_n;
+ guint64 scr_rate_d;
GST_DEBUG ("parsing pack start");
@@ -1126,12 +1134,12 @@
demux->first_scr_offset = demux->last_scr_offset;
demux->base_time = MPEGTIME_TO_GSTTIME (demux->first_scr);
/* at begin consider the new_rate as the scr rate, bytes/clock ticks */
- demux->scr_rate_n = new_rate;
- demux->scr_rate_d = CLOCK_FREQ;
+ scr_rate_n = new_rate;
+ scr_rate_d = CLOCK_FREQ;
} else if (demux->first_scr_offset != demux->last_scr_offset) {
/* estimate byte rate related to the SCR */
- demux->scr_rate_n = demux->last_scr_offset - demux->first_scr_offset;
- demux->scr_rate_d = scr - demux->first_scr;
+ scr_rate_n = demux->last_scr_offset - demux->first_scr_offset;
+ scr_rate_d = scr_adjusted - demux->first_scr;
}
GST_DEBUG_OBJECT (demux, "%s mode scr: %" G_GUINT64_FORMAT " at %"
@@ -1141,8 +1149,7 @@
((demux->sink_segment.rate >= 0.0) ? "forward" : "backward"),
scr, demux->last_scr_offset,
demux->first_scr, demux->first_scr_offset,
- demux->scr_rate_n, demux->scr_rate_d,
- (float) demux->scr_rate_n / demux->scr_rate_d);
+ scr_rate_n, scr_rate_d, (float) scr_rate_n / scr_rate_d);
/* adjustment of the SCR */
if (demux->current_scr != G_MAXUINT64) {
@@ -1188,6 +1195,9 @@
GST_DEBUG_OBJECT (demux, "discont found, diff: %" G_GINT64_FORMAT
", adjust %" G_GINT64_FORMAT, diff, demux->scr_adjust);
scr_adjusted = demux->next_scr;
+ /* don't update rate estimation on disconts */
+ scr_rate_n = demux->scr_rate_n;
+ scr_rate_d = demux->scr_rate_d;
} else {
demux->next_scr = scr_adjusted;
}
@@ -1196,6 +1206,8 @@
/* update the current_scr and rate members */
demux->mux_rate = new_rate;
demux->current_scr = scr_adjusted;
+ demux->scr_rate_n = scr_rate_n;
+ demux->scr_rate_d = scr_rate_d;
/* Reset the bytes_since_scr value to count the data remaining in the
* adapter */
------------------------------------------------------------------------------