Commit 7e62fb83 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

gst/matroska/matroska-demux.c: Advance stream time for lagging subtitle...

gst/matroska/matroska-demux.c: Advance stream time for lagging subtitle streams by sending newsegment events with the...

Original commit message from CVS:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_sync_streams):
Advance stream time for lagging subtitle streams by sending
newsegment events with the update flag set.
parent 45dd1af7
2006-02-14 Tim-Philipp Müller <tim at centricular dot net>
* gst/matroska/matroska-demux.c: (gst_matroska_demux_sync_streams):
Advance stream time for lagging subtitle streams by sending
newsegment events with the update flag set.
2006-02-14 Edward Hervey <edward@fluendo.com>
* gst/avi/gstavidemux.c: (gst_avi_demux_stream_header):
......
......@@ -1933,49 +1933,34 @@ gst_matroska_ebmlnum_sint (guint8 * data, guint size, gint64 * num)
static void
gst_matroska_demux_sync_streams (GstMatroskaDemux * demux)
{
/* FIXME: add filler events or buffers back */
#if 0
gint stream_nr;
GstMatroskaTrackContext *context;
GST_DEBUG ("Sync to %" GST_TIME_FORMAT, GST_TIME_ARGS (demux->pos));
GST_LOG ("Sync to %" GST_TIME_FORMAT, GST_TIME_ARGS (demux->pos));
for (stream_nr = 0; stream_nr < demux->num_streams; stream_nr++) {
GstMatroskaTrackContext *context;
context = demux->src[stream_nr];
if (context->type != GST_MATROSKA_TRACK_TYPE_SUBTITLE)
continue;
GST_DEBUG ("Checking for resync on stream %d (%" GST_TIME_FORMAT ")",
GST_LOG ("Checking for resync on stream %d (%" GST_TIME_FORMAT ")",
stream_nr, GST_TIME_ARGS (context->pos));
/* does it lag? 1 second is a random treshold... */
/* does it lag? 0.5 seconds is a random treshold... */
if (context->pos + (GST_SECOND / 2) < demux->pos) {
GstEvent *event;
static gboolean showed_msg = FALSE; /* FIXME */
event = gst_event_new_filler ();
/* FIXME: fillers in 0.9 aren't specified properly yet
event = gst_event_new_filler_stamped (context->pos,
demux->pos - context->pos); */
if (!showed_msg) {
g_message ("%s: fix filler stuff when spec'ed out in core", G_STRLOC);
showed_msg = TRUE;
}
GST_DEBUG ("Synchronizing stream %d with others by advancing time "
"from %" GST_TIME_FORMAT " to %" GST_TIME_FORMAT, stream_nr,
GST_TIME_ARGS (context->pos), GST_TIME_ARGS (demux->pos));
context->pos = demux->pos;
/* sync */
GST_DEBUG ("Synchronizing stream %d with others by sending filler "
"at time %" GST_TIME_FORMAT " and duration %" GST_TIME_FORMAT
" to time %" GST_TIME_FORMAT, stream_nr,
GST_TIME_ARGS (context->pos),
GST_TIME_ARGS (demux->pos - context->pos),
GST_TIME_ARGS (demux->pos));
gst_pad_push_event (context->pad, event);
/* advance stream time */
gst_pad_push_event (context->pad,
gst_event_new_new_segment (TRUE, demux->segment_rate,
GST_FORMAT_TIME, demux->pos, -1, demux->pos));
}
}
#endif
}
static gboolean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment