After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 326998 - GstBaseSrc's send_event handler ignores seek requests after pad activation
GstBaseSrc's send_event handler ignores seek requests after pad activation
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.5
Assigned To: Wim Taymans
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-01-14 21:41 UTC by Tim-Philipp Müller
Modified: 2006-03-27 11:49 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tim-Philipp Müller 2006-01-14 21:41:45 UTC
Scenario:

int
main (int argc, char **argv)
{
  GstElement *src;

  gst_init (&argc, &argv);

  src = gst_element_factory_make ("cdparanoiasrc", NULL);
  gst_element_set_state (src, GST_STATE_PAUSED);
  gst_element_get_state (src, NULL, NULL, -1);

  /* seek to track #3 (2 as counting from 0 here) */
  gst_element_seek (src, 1.0, gst_format_get_by_nick ("track"), 0,
                    GST_SEEK_TYPE_SET, 2, GST_SEEK_TYPE_NONE, 0);

  gst_element_set_state (src, GST_STATE_PLAYING);

  ...
}

This seek request is going to be swallowed, because gst_base_src_send_event() simply saves the seek request as pending_seek, which is only ever looked at at pad activation time, so it's never executed when we're after pad activation already.
Comment 1 Wim Taymans 2006-02-14 16:37:20 UTC
yah, silly. the event should only be stored when the element is not able to respond immediatly.
Comment 2 Wim Taymans 2006-03-27 09:04:11 UTC
Hello!

Judging from the ChangeLog, it looks like you implemented seeking in
gstbasesrc.c. May I suggest the following patch to enable seeking on
elements (not pads) that are running? 

Currently, you just store the event in data.ABI.pending_seek which is
checked in gst_base_src_activate_push. But if the pipeline is running
and  gst_base_src_activate_push has already been called, the seek will
never be performed.

Thanks a lot!

Regards

Lutz Müller

Index: gstbasesrc.c
===================================================================
RCS file: /cvs/gstreamer/gstreamer/libs/gst/base/gstbasesrc.c,v
retrieving revision 1.99
diff -u -3 -p -b -B -d -r1.99 gstbasesrc.c
--- gstbasesrc.c        8 Mar 2006 13:44:55 -0000       1.99
+++ gstbasesrc.c        24 Mar 2006 21:57:03 -0000
@@ -884,6 +884,10 @@ gst_base_src_send_event (GstElement * el
   switch (GST_EVENT_TYPE (event)) {
     case GST_EVENT_SEEK:
     {
+      if (GST_PAD_ACTIVATE_MODE (GST_BASE_SRC_PAD (src)) == GST_ACTIVATE_PUSH) {
+        result = gst_base_src_perform_seek (src, event, FALSE);
+        break;
+      }
       GST_OBJECT_LOCK (src);
       /* gst_event_replace? */
       if (src->data.ABI.pending_seek)
Comment 3 Wim Taymans 2006-03-27 11:48:27 UTC
        Inspired by a patch of: Lutz Mueller <lutz at topfrose dot de>

        * libs/gst/base/gstbasesrc.c: (gst_base_src_finalize),
        (gst_base_src_send_event), (gst_base_src_change_state):
        Handle element seek correctly when we are streaming.
        Fixes #326998.