ext/ogg/gstoggmux.c: Don't generate out-of-order timestamps from oggmux, instead clamp output timestamps to be >= the...

Original commit message from CVS:
* ext/ogg/gstoggmux.c: (gst_ogg_mux_clear),
(gst_ogg_mux_push_buffer):
Don't generate out-of-order timestamps from oggmux, instead clamp
output timestamps to be >= the previously output ts.
Fixes #355595
This commit is contained in:
Michael Smith 2006-09-18 10:57:28 +00:00
parent 6b4cf938a4
commit 084dacbba2
2 changed files with 20 additions and 0 deletions

View file

@ -1,3 +1,11 @@
2006-09-18 Michael Smith <msmith@fluendo.com>
* ext/ogg/gstoggmux.c: (gst_ogg_mux_clear),
(gst_ogg_mux_push_buffer):
Don't generate out-of-order timestamps from oggmux, instead clamp
output timestamps to be >= the previously output ts.
Fixes #355595
2006-09-18 Michael Smith <msmith@fluendo.com>
* gst/tcp/gstmultifdsink.c: (gst_sync_method_get_type),

View file

@ -111,6 +111,9 @@ struct _GstOggMux
/* next timestamp for the page */
GstClockTime next_ts;
/* Last timestamp actually output on src pad */
GstClockTime last_ts;
/* offset in stream */
guint64 offset;
@ -293,6 +296,7 @@ gst_ogg_mux_clear (GstOggMux * ogg_mux)
ogg_mux->delta_pad = NULL;
ogg_mux->offset = 0;
ogg_mux->next_ts = 0;
ogg_mux->last_ts = GST_CLOCK_TIME_NONE;
}
static void
@ -517,6 +521,14 @@ gst_ogg_mux_push_buffer (GstOggMux * mux, GstBuffer * buffer)
mux->offset += GST_BUFFER_SIZE (buffer);
GST_BUFFER_OFFSET_END (buffer) = mux->offset;
/* Ensure we have monotonically increasing timestamps in the output. */
if (GST_BUFFER_TIMESTAMP_IS_VALID (buffer)) {
if (GST_BUFFER_TIMESTAMP (buffer) < mux->last_ts)
GST_BUFFER_TIMESTAMP (buffer) = mux->last_ts;
else
mux->last_ts = GST_BUFFER_TIMESTAMP (buffer);
}
caps = gst_pad_get_negotiated_caps (mux->srcpad);
gst_buffer_set_caps (buffer, caps);
gst_caps_unref (caps);