From 492fe80f2bbd974537c18fee39a2a2892b12c1b0 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 8 Jun 2002 23:48:43 +0000 Subject: [PATCH] Disable sync Original commit message from CVS: Disable sync --- gst/mpegstream/gstmpegparse.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gst/mpegstream/gstmpegparse.c b/gst/mpegstream/gstmpegparse.c index 387b092283..8d2d61dd5c 100644 --- a/gst/mpegstream/gstmpegparse.c +++ b/gst/mpegstream/gstmpegparse.c @@ -137,7 +137,7 @@ gst_mpeg_parse_class_init (GstMPEGParseClass *klass) FALSE, G_PARAM_READABLE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SYNC, g_param_spec_boolean ("sync", "Sync", "Synchronize on the stream SCR", - TRUE, G_PARAM_READWRITE)); + FALSE, G_PARAM_READWRITE)); gobject_class->get_property = gst_mpeg_parse_get_property; gobject_class->set_property = gst_mpeg_parse_set_property; @@ -171,7 +171,7 @@ gst_mpeg_parse_init (GstMPEGParse *mpeg_parse) mpeg_parse->packetize = NULL; mpeg_parse->current_scr = 0; mpeg_parse->previous_scr = 0; - mpeg_parse->sync = TRUE; + mpeg_parse->sync = FALSE; /* zero counters (should be done at RUNNING?) */ mpeg_parse->bit_rate = 0; @@ -394,6 +394,9 @@ gst_mpeg_parse_loop (GstElement *element) /* we're not sending data as long as no new SCR was found */ if (mpeg_parse->discont_pending) { if (!mpeg_parse->scr_pending) { + if (mpeg_parse->clock && mpeg_parse->sync) { + gst_clock_handle_discont (mpeg_parse->clock, MPEGTIME_TO_GSTTIME (mpeg_parse->current_scr)); + } if (CLASS (mpeg_parse)->handle_discont) { CLASS (mpeg_parse)->handle_discont (mpeg_parse); } @@ -409,7 +412,8 @@ gst_mpeg_parse_loop (GstElement *element) if (CLASS (mpeg_parse)->send_data) CLASS (mpeg_parse)->send_data (mpeg_parse, data, time); - if (mpeg_parse->clock && mpeg_parse->sync) { + if (mpeg_parse->clock && mpeg_parse->sync && !mpeg_parse->discont_pending) { + GST_DEBUG (GST_CAT_CLOCK, "syncing mpegparse"); gst_element_clock_wait (GST_ELEMENT (mpeg_parse), mpeg_parse->clock, time, NULL); } @@ -504,6 +508,8 @@ gst_mpeg_parse_handle_src_event (GstPad *pad, GstEvent *event) if (!gst_bytestream_seek (mpeg_parse->packetize->bs, desired_offset, GST_SEEK_METHOD_SET)) { return FALSE; } + mpeg_parse->discont_pending = TRUE; + mpeg_parse->scr_pending = TRUE; break; } default: