diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gst/udp/gstudpsrc.c | 21 | ||||
-rw-r--r-- | gst/udp/gstudpsrc.h | 1 |
3 files changed, 25 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2004-08-19 Jan Schmidt <thaytan@mad.scientist.com> + * gst/udp/gstudpsrc.c: (gst_udpsrc_init), (gst_udpsrc_get): + * gst/udp/gstudpsrc.h: + Don't call gst_pad_push in a get function. Fixes #150449 + 2004-08-18 Wim Taymans <wim@fluendo.com> * gst/tcp/gstfdset.c: (gst_fdset_free), (gst_fdset_set_mode), diff --git a/gst/udp/gstudpsrc.c b/gst/udp/gstudpsrc.c index 8486376c..801176c9 100644 --- a/gst/udp/gstudpsrc.c +++ b/gst/udp/gstudpsrc.c @@ -175,6 +175,7 @@ gst_udpsrc_init (GstUDPSrc * udpsrc) udpsrc->multi_group = g_strdup (UDP_DEFAULT_MULTICAST_GROUP); udpsrc->first_buf = TRUE; + udpsrc->defer_data = NULL; } static GstData * @@ -193,6 +194,13 @@ gst_udpsrc_get (GstPad * pad) udpsrc = GST_UDPSRC (GST_OBJECT_PARENT (pad)); + if (udpsrc->defer_data != NULL) { + GstData *outdata = udpsrc->defer_data; + + udpsrc->defer_data = NULL; + return outdata; + } + FD_ZERO (&read_fds); FD_SET (udpsrc->sock, &read_fds); if (udpsrc->control != CONTROL_NONE) { @@ -275,7 +283,7 @@ gst_udpsrc_get (GstPad * pad) discont = gst_event_new_discontinuous (FALSE, GST_FORMAT_TIME, current_time, NULL); - gst_pad_push (udpsrc->srcpad, GST_DATA (discont)); + udpsrc->defer_data = GST_DATA (discont); } udpsrc->first_buf = FALSE; @@ -296,12 +304,21 @@ gst_udpsrc_get (GstPad * pad) gst_buffer_unref (outbuf); outbuf = NULL; } - } } else { perror ("select"); outbuf = NULL; } + if (udpsrc->defer_data) { + GstData *databuf = udpsrc->defer_data; + + udpsrc->defer_data = GST_DATA (outbuf); + return databuf; + } + + if (outbuf == NULL) + return GST_DATA (gst_event_new (GST_EVENT_EMPTY)); + return GST_DATA (outbuf); } diff --git a/gst/udp/gstudpsrc.h b/gst/udp/gstudpsrc.h index f16673df..7573a2c6 100644 --- a/gst/udp/gstudpsrc.h +++ b/gst/udp/gstudpsrc.h @@ -75,6 +75,7 @@ struct _GstUDPSrc { GstClock *clock; gboolean first_buf; + GstData *defer_data; }; struct _GstUDPSrcClass { |