[gstreamer-bugs] [Bug 623104] New: [queue2] might create short buffer in get_range

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Jun 29 02:04:37 PDT 2010


https://bugzilla.gnome.org/show_bug.cgi?id=623104
  GStreamer | gstreamer (core) | git

           Summary: [queue2] might create short buffer in get_range
    Classification: Desktop
           Product: GStreamer
           Version: git
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: t.i.m at zen.co.uk
         QAContact: gstreamer-bugs at lists.sourceforge.net
      GNOME target: ---
     GNOME version: ---


Demuxers and other elements operating in pull mode usually expect to get all
the bytes they requested in pull_range(). pull_range() may return FLOW_OK +
fewer bytes only when the end of the file has been reached and there are not
enough bytes available.

This means most demuxers will (correctly, I think) assume EOS if pull_range()
delivers fewer bytes than requested.

The following code looks like it could lead to a short buffer being returned in
the middle of a stream:

GstFlowReturn
gst_queue2_create_read (GstQueue2 * queue, guint64 offset,
    guint length, GstBuffer ** buffer)
{
  ...
  GST_LOG_OBJECT (queue, "Reading %d bytes", length);
  res = fread (GST_BUFFER_DATA (buf), 1, length, queue->temp_file);
  GST_LOG_OBJECT (queue, "read %" G_GSIZE_FORMAT " bytes", res);

  if (G_UNLIKELY (res == 0)) {
    /* check for errors or EOF */
    ....
  }

  length = res;

  GST_BUFFER_SIZE (buf) = length;
  GST_BUFFER_OFFSET (buf) = offset;
  GST_BUFFER_OFFSET_END (buf) = offset + length;
  ...
}

Since it's called from _get_range() as well, this seems undesirable.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.




More information about the Gstreamer-bugs mailing list