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 642942 - adder: offset_end field of outgoing buffers is set to GST_BUFFER_OFFSET_NONE
adder: offset_end field of outgoing buffers is set to GST_BUFFER_OFFSET_NONE
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal normal
: 0.10.33
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-02-22 04:49 UTC by Leo Singer
Modified: 2011-02-24 12:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.08 KB, patch)
2011-02-22 04:49 UTC, Leo Singer
committed Details | Review
Python script demonstrating bug (558 bytes, patch)
2011-02-22 04:49 UTC, Leo Singer
none Details | Review

Description Leo Singer 2011-02-22 04:49:06 UTC
Created attachment 181555 [details] [review]
proposed patch

adder does not set the offset_end field of its output buffers.

If the input buffers on the sink pads have exactly the same offsets and offsets_end, then that's OK, because in gst_adder_collected, the call to gst_collect_pads_take_buffer will return an unmodified input buffer from the first sink pad -- and this will have the offset_end field filled in by the upstream pipeline.  That buffer is recycled as the output buffer, so it already has all of its metadata set.

However, if the sink pads have offsets and offsets_end that don't exactly line up, then gst_collect_pads_take_buffer will have to return a new buffer, either by merging existing buffers or by creating a sub-buffer.  This new buffer will have the offset_end field set to GST_BUFFER_OFFSET_NONE.

The attached script reproduces this error.  It consists of a pipeline with two audiotestsrc's with different values of the "samplesperbuffer" property, both attached to an adder.  The timestamp, duration, offset, and offset_end fields will look like this:

0 7812500 0 18446744073709551615
7812500 7812500 128 18446744073709551615
15625000 7812500 256 18446744073709551615
...

Either set both "samplesperbuffer" properties to the same value, or apply the attached patch, and the offset_end fields get filled in:

0 7812500 0 128
7812500 7812500 128 256
15625000 7812500 256 384
...

The attached patch adds code to fill in the offset_end field.
Comment 1 Leo Singer 2011-02-22 04:49:49 UTC
Created attachment 181556 [details] [review]
Python script demonstrating bug
Comment 2 Sebastian Dröge (slomo) 2011-02-24 12:29:03 UTC
commit 27178f7aff309132ce32bba1d995ab59d2466eeb
Author: Leo Singer <leo.singer@ligo.org>
Date:   Mon Feb 21 20:34:41 2011 -0800

    adder: Fill in offset_end field of outgoing buffers
    
    ... rather than leave it as GST_BUFFER_OFFSET_NONE
    
    Fix bug #642942.