[gstreamer-bugs] [Bug 543444] New: gst_base_sink_get_position can return 0 unexpectedly

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Thu Jul 17 08:11:49 PDT 2008


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=543444

  GStreamer | gstreamer (core) | Ver: HEAD CVS
           Summary: gst_base_sink_get_position can return 0 unexpectedly
           Product: GStreamer
           Version: HEAD CVS
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: wingo at pobox.com
         QAContact: gstreamer-bugs at lists.sourceforge.net
     GNOME version: Unspecified
   GNOME milestone: Unspecified


Not sure if this is a bug, but it's certainly unexpected. Let's say I'm sending
50 flushing seeks per second to a pipeline while scrubbing. I make sure that
the pipeline is prerolled before I seek, so I don't overload it with flushing
seeks. Let's say at the same time, I'm querying the pipeline's position 100
times a second. I disregard failed queries, taking the last value that I saw.

The problem is that e.g. when scrubbing around second 200 of a MOV file, that
basesink sometimes returns 0. I haven't investigated too much, but things like
this creep me out, in gstbasesink.c:3243:

      /* collect all data we need holding the lock */
      if (GST_CLOCK_TIME_IS_VALID (basesink->segment.time))
        time = basesink->segment.time;
      else
        time = 0;

and in gstbasesink.c:2546:

    case GST_EVENT_FLUSH_STOP:
      ...
      /* we need new segment info after the flush. */
      gst_segment_init (&basesink->segment, GST_FORMAT_UNDEFINED);
      gst_segment_init (basesink->abidata.ABI.clip_segment,
          GST_FORMAT_UNDEFINED);
      basesink->have_newsegment = FALSE;

So in this case after getting the flush_stop but before getting the first
buffer, get_position will report 0. (gst_segment_init() sets segment.time to
0.) But we actually don't know the position then.

I guess the right thing to do is to protect have_newsegment with the object
lock (currently it's just the stream lock), and to make get_position return -1
or fail when we don't actually have the new segment. Or does this diagnostic
look wrong?


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=543444.




More information about the Gstreamer-bugs mailing list