From 694be55c05217889374abbae67a6879710303395 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 13 Jun 2012 13:36:45 +0200 Subject: [PATCH] rtspsrc: Don't reset time in flush-stop Don't reset the time in flush-stop. Live sources can do this flush in the playing state and so the pipeline will never have a chance to update the base_time of the elements, which only happens when going from paused to playing. --- gst/rtsp/gstrtspsrc.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 959c3be12f..297260c077 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -1664,8 +1664,6 @@ gst_rtspsrc_flush (GstRTSPSrc * src, gboolean flush, gboolean playing) gint cmd, i; GstState state; GList *walk; - GstClock *clock; - GstClockTime base_time = GST_CLOCK_TIME_NONE; if (flush) { event = gst_event_new_flush_start (); @@ -1673,31 +1671,20 @@ gst_rtspsrc_flush (GstRTSPSrc * src, gboolean flush, gboolean playing) cmd = CMD_WAIT; state = GST_STATE_PAUSED; } else { - event = gst_event_new_flush_stop (TRUE); + event = gst_event_new_flush_stop (FALSE); GST_DEBUG_OBJECT (src, "stop flush; playing %d", playing); cmd = CMD_LOOP; if (playing) state = GST_STATE_PLAYING; else state = GST_STATE_PAUSED; - clock = gst_element_get_clock (GST_ELEMENT_CAST (src)); - if (clock) { - base_time = gst_clock_get_time (clock); - gst_object_unref (clock); - } } gst_rtspsrc_push_event (src, event); gst_rtspsrc_loop_send_cmd (src, cmd, CMD_LOOP); - /* set up manager before data-flow resumes */ /* to manage jitterbuffer buffer mode */ - if (src->manager) { - gst_element_set_base_time (GST_ELEMENT_CAST (src->manager), base_time); - /* and to have base_time trickle further down, - * e.g. to jitterbuffer for its timeout handling */ - if (base_time != -1) - gst_element_set_state (GST_ELEMENT_CAST (src->manager), state); - } + if (src->manager) + gst_element_set_state (GST_ELEMENT_CAST (src->manager), state); /* make running time start start at 0 again */ for (walk = src->streams; walk; walk = g_list_next (walk)) { @@ -1706,15 +1693,10 @@ gst_rtspsrc_flush (GstRTSPSrc * src, gboolean flush, gboolean playing) for (i = 0; i < 2; i++) { /* for udp case */ if (stream->udpsrc[i]) { - if (base_time != -1) - gst_element_set_base_time (stream->udpsrc[i], base_time); gst_element_set_state (stream->udpsrc[i], state); } } } - /* for tcp interleaved case */ - if (base_time != -1) - gst_element_set_base_time (GST_ELEMENT_CAST (src), base_time); } static GstRTSPResult -- 2.34.1